[Q]how to disable collisions within a same group?

hevi

29-09-2009 17:22:00

hey everyone
I'm working on a 'AirStrike 3D' kind of game
but I have some problems because of collision groups ; I dont want the missiles to collide with eachother and also with the helicopter but with the enemy troops.
lets say that the missiles are in group 1, the helicopter is in 2 and the enemy troops are in 3. in that case i can easily disable collisions between group 1 and 2, but the problem is all the missiles are in group 1 and I couldnt manage to disable collisions within the same group.
I used
m_pNxScene->getScene()->setGroupCollisionFlag(1, 1, false);

but it didn't work :(

briefly
how can I disable the collisions of the objects within the same group? Actorflags is not the answer because of performance constraints as there might be tens of missiles in the game.

my collision map in the game is;
Group 1 - Group 1 => collisions disabled
Group 1 - Group 2 => collisions disabled
Group 1 - Group 3 => collisions enabled
...
Group 2 - Group 2 => collisions disabled
Group 2 - Group 3 => collisions enabled
...
Group 3 - Group 3 => collisions disabled
...

betajaen

29-09-2009 17:35:50

Hmm, are you setting the group id of your missiles/helicopters and troops to the actor or to the shape? Because that function is for shapes.

hevi

29-09-2009 17:44:08

Hmm, are you setting the group id of your missiles/helicopters and troops to the actor or to the shape? Because that function is for shapes.nction is for shapes.

yea I know the problem from a previous post, they are all shapes and yes I do set them with the code below;
pBullet->m_pPhysicsObject->getNxActor()->setGroup(1);

the collision groups are already working for missiles/helicopters but not for missiles/missiles.

I also tried to set by using descriptor but it didn't work neither

btw, thnx for the fast reply ;)

betajaen

29-09-2009 17:54:19

Then it may be a "feature" of PhysX then.

All I can suggest is to disable them by hand;

mScene->setActorFlags(missile1, missile2, Enums::ContactPairFlags_Ignore);
mScene->setActorFlags(missile1, missile3, Enums::ContactPairFlags_Ignore);
etc.

hevi

29-09-2009 18:00:56

actually that's what i am doing right now, and the complexity is n^2 :(
anyway thanks a lot!