How to disable collision with bodies?

Post Reply
i7.strelok
Posts: 21
Joined: Fri Jan 20, 2017 10:44 pm

How to disable collision with bodies?

Post by i7.strelok »

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.
User avatar
Typhontaur
Posts: 135
Joined: Fri Nov 04, 2005 2:22 pm

Re: How to disable collision with bodies?

Post by Typhontaur »

Code: Select all

rigidBody->setCollisionFlags(rigidBody->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE);
...
and..
rigidBody->setCollisionFlags(rigidBody->getCollisionFlags() & ~btCollisionObject::CF_NO_CONTACT_RESPONSE);
maybe is good, maybe no, try....
i7.strelok
Posts: 21
Joined: Fri Jan 20, 2017 10:44 pm

Re: How to disable collision with bodies?

Post by i7.strelok »

One of these lines deactivates or the other active?
User avatar
Typhontaur
Posts: 135
Joined: Fri Nov 04, 2005 2:22 pm

Re: How to disable collision with bodies?

Post by Typhontaur »

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);
i7.strelok
Posts: 21
Joined: Fri Jan 20, 2017 10:44 pm

Re: How to disable collision with bodies?

Post by i7.strelok »

Muchas gracias! :D :D :D
Post Reply