AndresTraks / BulletSharpPInvoke

.NET wrapper for the Bullet physics library using Platform Invoke

Home Page:http://andrestraks.github.io/BulletSharp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BulletObject.Initialize(IntPtr) throws ArgumentNullException

straightcurve opened this issue · comments

commented

Check out code at: https://github.com/straightcurve/bullet-physics-pinvoke
Throws this error:
Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: native at BulletSharp.BulletObject.Initialize(IntPtr native) at BulletSharp.BroadphaseProxy..ctor(IntPtr native) at BulletSharp.DbvtProxy..ctor(IntPtr native) at BulletSharp.AlignedCollisionObjectArray.SetBodyBroadphaseHandle(CollisionObject item, BroadphaseInterface broadphase) at BulletSharp.AlignedCollisionObjectArray.Add(CollisionObject item) at BulletSharp.CollisionWorld.AddCollisionObject(CollisionObject collisionObject) at test.Program.Main(String[] args) in /home/tony/Desktop/mmm/server/test/Program.cs:line 23

DiscreteDynamicsWorld is usually used instead of CollisionWorld, you can try that.
But CollisionWorld should work too, so I'll take a look today or tomorrow.

https://pybullet.org/Bullet/BulletFull/classbtDynamicsWorld.html
A RigidBody can be inserted into a DynamicsWorld with AddRigidBody.
A RigidBody can also be inserted into a CollisionWorld with AddCollisionObject, because RigidBody inherits from CollisionObject, but I don't know if that's semantically correct.

A DiscreteDynamicsWorld will work with anything except soft bodies and multibodies, so I'd still recommend that.

commented