rotation problem (Body vs. Entity)

anear

26-03-2007 13:31:44

I have a problem regarding to rotating a NxOgre body. In the following screenshot, the left hand is an Ogre::Entity, and the right hand is an NxOgre::Body. I'm trying to yaw them 180 degree.

http://picasaweb.google.com/minhua.eunice.ma/Temp/photo#5046207681214723570

This is the code:

ent = mSceneMgr->createEntity("LinkedBody3","Lhand.mesh");
node = mSceneMgr->getRootSceneNode()->createChildSceneNode( "handNode3", Vector3(-4,3,-4));
node->attachObject( ent );
node->scale(30, 30, 30);
node->yaw(Degree(180));

myCube = mScene->createBody("LinkedBody4","Rhand.mesh", new cubeShape(1),10.0f,Vector3(4,3,-4));
myCube->setIgnoreGravity(true);
myCube->mNode->scale(30, 30, 30);
myCube->mNode->yaw(Degree(180));


I tried pitch and roll on "myCube", it showed the same pose. Body->mNode->pitch/yaw/roll just doesn't work.

Any thought on this? Thank you.

betajaen

26-03-2007 14:35:14

Well of course modifying the mNode in the body won't work.

Can't you attach your second hand to the the node in the body?

anear

26-03-2007 14:58:37

Thanks for yr reply, betajaen. I now use Quaternion in the pose parameter and the problem solved :-)


myCube = mScene->createBody("LinkedBody4","Rhand.mesh", new cubeShape(1),10.0f,pose(Vector3(4,3,-4), Quaternion(0,0,1,0)));