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.
Disabling all collision on an object at runtime.
-
- Posts: 2
- Joined: Wed Oct 12, 2011 8:44 pm
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: Disabling all collision on an object at runtime.
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:
Another way is to set the collision flag:
Code: Select all
Body->setCollisionFlags(Body->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE));
-
- Posts: 2
- Joined: Wed Oct 12, 2011 8:44 pm
Re: Disabling all collision on an object at runtime.
I will give that a go, many thanks!