I have 4 rigid bodies, but I want to turn on and off your collision when I want, but I can not.
I'm using the OgreBullet wrapper, but it does not affect using pure code
I thought the line was "setActivationState" but it did not work.
How to disable collision with bodies?
-
- Posts: 135
- Joined: Fri Nov 04, 2005 2:22 pm
Re: How to disable collision with bodies?
Code: Select all
rigidBody->setCollisionFlags(rigidBody->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE);
...
and..
rigidBody->setCollisionFlags(rigidBody->getCollisionFlags() & ~btCollisionObject::CF_NO_CONTACT_RESPONSE);
-
- Posts: 21
- Joined: Fri Jan 20, 2017 10:44 pm
Re: How to disable collision with bodies?
One of these lines deactivates or the other active?
-
- Posts: 135
- Joined: Fri Nov 04, 2005 2:22 pm
Re: How to disable collision with bodies?
i7.strelok wrote:One of these lines deactivates or the other active?
Code: Select all
DEACTIVATE (OR)---->
rigidBody->setCollisionFlags(rigidBody->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE);
ACTIVATE---(XOR)->
rigidBody->setCollisionFlags(rigidBody->getCollisionFlags() & ~btCollisionObject::CF_NO_CONTACT_RESPONSE);
-
- Posts: 21
- Joined: Fri Jan 20, 2017 10:44 pm
Re: How to disable collision with bodies?
Muchas gracias!