Jointed Actors spinning

NoodlesOnMyBack

21-11-2008 06:20:48

I have several dynamic actors atached each other by fixed joints, but the bodies start spinning and moving around the place by themselves, like pulled by an invisible force.
This is probably a stupid question, and i forgot to setup something.

NxOgre::JointParams jp;
jp.setToDefault();
...
Physics::getSingleton().getScene()->createFixedJoint(a2,a1,jp);

betajaen

21-11-2008 08:49:06

Most likely they are colliding with each other. I believe there is a joint param that disables collision with a pair of joined actors.

NoodlesOnMyBack

21-11-2008 18:12:46

I tried adding jp.mActorsCollidable = false; but no change :(
If i joint actors in pairs only (ie A->B and then B->C) they behave like they should, but when i joint more, like: actor A->B->C->D they spin.
Is there some specific order i should put them togheter?

NoodlesOnMyBack

21-11-2008 19:34:52

Heres an image of what i want to do, the wireframe boxes around the gun are the actors, in my application, the actors are created and positioned ok.
But as soon as the simulation start the actors spin around like i said previusly.Dont know what else to do.
Thanks in advance.

betajaen

21-11-2008 19:58:17

Right. You need to make those actors shapes (via a compound shape), and the entire gun one actor.

NoodlesOnMyBack

22-11-2008 16:29:30

I see the offset position, but dont know how to set the orientation.How?


CompoundShape* cs = new CompoundShape();
cs->add(new Cube(3, 0.5, 1, "offset: 0 -0.05 0"));
cs->add(new Cube(0.05, 0.1, 0.5, "offset: 1.26 0.25 0"));
cs->add(new Cube(0.05, 0.1, 0.5, "offset: -1.26 0.25 0"));

mActor = mScene->createActor("test", cs, Vector3(0, 10, 0), "mass: 10");

NoodlesOnMyBack

22-11-2008 18:50:42

Forget it, i did it like this:


NxOgre::ShapeParams sp;
sp.mLocalPose.M.fromQuat(GOActorsIter->second->getGlobalOrientationAsNxQuat());