Panda PhysX

Sorry for the slow response - I have been away for the weeend.

You are right, the shapeDesc going out of scope is causing the problem. When call actorDesc.addShape is just reads the NxShapeDesc pointer and hands it over to the NxActorDesc. PhysxActorDesc does not retain a PT of the PhysxShapeDesc.

The descriptors are not meant to be kept for a longer time, and they do not inhierit e. g. from TypedReferenceCount. As a general rule you should keep around all descriptors until the actual object is created, and then throw them away.

The actual objects (PhysxActor, PhysxMaterial, PhysxShape, …) are reference counted, and I store a reference to these objects in whatever other object owns them, so e. g. a PhysxActor instance can go out of scope without the instance being deleted.