Disabling all collision on an object at runtime.

Please don't post Bullet support questions here, use the above forums instead.
TVisineau
Posts: 2
Joined: Wed Oct 12, 2011 8:44 pm

Disabling all collision on an object at runtime.

Post by TVisineau »

I need to be able to disable and reenable collision for specific objects while my program is running based on user input. I've looked into the masks and whatnot, and havent found a way to set that data other than when the scene is initialized. Is there a way to change that data, or some easier way to just disable all collision for a specific object? The mask stuff all sounds great, and would work perfectly if I could find a way to change it later.

Thanks for any help you can give.
User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Re: Disabling all collision on an object at runtime.

Post by Dr.Shepherd »

I am not sure that if you can set the collision masks on the fly, I always set it at the initialization.

Another way is to set the collision flag:

Code: Select all

Body->setCollisionFlags(Body->getCollisionFlags() |    btCollisionObject::CF_NO_CONTACT_RESPONSE));
TVisineau
Posts: 2
Joined: Wed Oct 12, 2011 8:44 pm

Re: Disabling all collision on an object at runtime.

Post by TVisineau »

I will give that a go, many thanks!