How to disable collision between bodies

Night Elf

10-10-2007 00:10:37

I'm using "invisible walls" to prevent characters from falling into a cliff, but I need other bodies (explosion particles, etc.) to pass through that wall. How can I disable collision between certain bodies? I'm guessing actor groups may be involved, but I don't see how I would prevent the collision...

betajaen

10-10-2007 00:16:01

ShapeGroups.

Night Elf

10-10-2007 00:39:06

Thanks! It was really easy to implement :)

Night Elf

10-10-2007 16:05:43

I created two groups like this:

NxOgre::ShapeGroup* particleGroup = g_nxScene->createShapeGroup("Particle");
NxOgre::ShapeGroup* invisibleGroup = g_nxScene->createShapeGroup("Invisible");
particleGroup->setCollisionResponse(invisibleGroup, NxOgre::ShapeGroup::CR_No_Collision);

I assigned the "Invisible" group to invisible walls assigned the "Particle" group to the bodies that have to pass through.

The problem is that now, characters also pass through invisible walls. How can I make this work? I could create another group and assign it to characters, but as far as I can see, there's no way to pass a shape group to the character.

(As a feature request, if I can: it'd be nice if bodies and characters that don't belong to any group just defaulted to CR_Collision. I think it'd be the expected behaviour.)

betajaen

10-10-2007 16:10:17

Try creating a group before those groups, and see what happens. For some reason it may be re-creating group zero which the character uses.

Night Elf

10-10-2007 16:30:58

Thanks, I tried that but it didn't work... :(

EDIT: Apparently, thers's something strage going on. I removed the line that sets up the collision behaviour and the characters are still going through.

betajaen

10-10-2007 17:50:26

std::cout the Group ID's of those groups, theoretically they should be 1 and 2. Then see if you can get the ShapeGroup ID for the NxActor in the Character.

You'll have to use some PhysX code for the second part. If they come out as 1,2 and 0. We have a problem, else for some reason the character is using one of your groups.