Creating btRigidBody with NULL collision shape

allsey87
Posts: 33
Joined: Fri Oct 26, 2012 1:50 pm

Creating btRigidBody with NULL collision shape

Post by allsey87 »

I noticed in the ConstraintDemo that some bodies are created using NULL or a pointer to 0, collision shapes. I think I could use this in my program, but I want to check whether this is actually a feature that hasn't been documented or whether it is a temporary workaround that might be removed in the future...

As far as I can tell, this is meant to be used only with static bodies as kind of a reference point or node that other bodies can be connected to via constraints. Since there is no collision shape, there is nothing can collide with these bodies and they don't react with other bodies.

Has anyone had any experience with using this feature? what have you managed to use it for? Can this also work with dynamic bodies?
sharethis
Posts: 6
Joined: Sat May 04, 2013 3:18 pm

Re: Creating btRigidBody with NULL collision shape

Post by sharethis »

There is also a "btEmptyShape". I use for initialization so that the body can be added to the physics world automatically and can be threaten like any other rigid body. Later on in the code I may add a real collision shape to it. Since that feature exists, I don't assume that using a null pointer instead is a good idea.