Several difficulty with setCollisionResponse()

shibby3d

27-12-2007 16:35:59

Hello,

first : I did not find how to set a actorgroup for a shapeGroup in a Scene. So I wrote a shapeGroup constructor with actorGroup in parameter, but I think there is an other way ?

second : I got 2 actor group and 2 shapeGroup (actually 3 with the default) and I want disable collision between these two group (actor/shape), so I did :

mScene->createActorGroup("ActorNormaux");
mScene->createActorGroup("ActorTraversables");
NxActorGroup normalId = mScene->getActorGroup("ActorNormaux")->getGroupID();
NxActorGroup traverId = mScene->getActorGroup("ActorTraversables")->getGroupID();
ShapeGroup* normalSG = mScene->createShapeGroup(normalId,"Groupenormal");
ShapeGroup* traverSG = scene->createShapeGroup(traverId,"GroupeTraversables");
traverSG->setCollisionResponse(normalSG,ShapeGroup::CR_No_Collision);


but there are always collision between these group. What I missed ?

betajaen

27-12-2007 16:55:20

You need to assign those groups to the shapes and/or actors.

mScene->createActor("name", new CubeShape(1, "group: shapeGroupName", Position, "mass: 10, group: actorGroupName");

Usually, it's easier and requires less code just to assign the group to the actor if you want no-collisions with other actor groups. ShapeGroups are used for other fancy things such as collision callbacks.

shibby3d

27-12-2007 17:11:32

Thank you