Changing CollisionGroup & collisionMask... [solved]

Chaster
Posts: 19
Joined: Mon Oct 01, 2007 7:24 pm

Changing CollisionGroup & collisionMask... [solved]

Post by Chaster »

Hello everyone,

I'm still trying to get a handle on Bullet, but it's coming along... I have a question - how can I change the collisionGroup & collisionMask filters AFTER a collision object has been added to a simulation world? I know how to do it via addCollisionObject() but was wondering how to do it after the object has already been added...?

EDIT : never mind, I see that the members are public.. duh.

Chaster
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Changing CollisionGroup & collisionMask... [solved]

Post by Erwin Coumans »

Chaster wrote:Hello everyone,

I'm still trying to get a handle on Bullet, but it's coming along... I have a question - how can I change the collisionGroup & collisionMask filters AFTER a collision object has been added to a simulation world? I know how to do it via addCollisionObject() but was wondering how to do it after the object has already been added...?

EDIT : never mind, I see that the members are public.. duh.

Chaster
Actually, if you want to change the collisionGroup/Mask AFTER you added the collision object:

you should remove the object, set the collisionGroup/Mask, and add them again. Otherwise the pairs might not be updated correctly.

Hope this helps,
Erwin
Chaster
Posts: 19
Joined: Mon Oct 01, 2007 7:24 pm

Re: Changing CollisionGroup & collisionMask... [solved]

Post by Chaster »

Ah, thank you for the tip Erwin. I was just about to post a question about why sometimes the collisionGroup and CollisionMask was used correctly, and sometimes not, but you just answered it.

Many thanks,

Eric