libgdx/libgdx — pull request #493 by xoppa (2013-07-02 20:00:10+00:00)
Title: Bullet: keep reference to MotionState and CollisionShape

This change makes btCollisionObject, btRigidBody and btRigidBodyConstructionInfo keep a reference to its MotionState and CollisionShape. So they don't get destroyed by the garbage collector if you don't maintain a reference of your own (which seems a common mistake when using the bullet wrapper). The used btRigidBodyConstructionInfo is not referenced (it doesn't need to outlive the object), only used to pass the reference to the object. Note that the referenced motionstate or collisionshape are not destroyed when the object is destroyed. However the GC will do this eventually, so you can "safely" not keep a reference to them (although I would not recommend that).

I also renamed the getters/setters of btRigidBodyConstructionInfo (e.g. getM_mass() is now getMass()), which slightly breaks backwards compatibility.