Beginner's ask : Rotate entity of body

Yakuru

13-02-2008 11:28:39

Hi,
So First look at my code it will be more efficient :

mNxOgreCamion=mScene->createBody("camionPolice.mesh",new CubeShape(30.5f),Vector3::ZERO,"Mass: 20");

mNxOgreCamion->getNode()->rotate(Vector3(1,0,0),Ogre::Radian(-_PI_/2));




So as you can see I want to rotate my entity with his node but it doesn't work,the entity stay at the same position .

why i can't rotate my entity in this way.

(note that if i change the scale of my node, my entity change well)

thanks

betajaen

13-02-2008 11:39:22

Because NxOgre will put it right back after you've done it.

If your entity is facing in the wrong direction as you intended then you can use MeshMagick (on the main forums) to re-do the mesh for you, or you can adjust the rotation of the Actor using mNxOgreCamion->setGlobalOrientation().

Yakuru

13-02-2008 12:49:09

Thanks for reply :)

I used the setGlobalOrientation function and it work as i want.

betajaen

13-02-2008 12:53:29

A more simpler way is just to give out a quaternion in it's pose when you create the thing:

mNxOgreCamion=mScene->createBody("camionPolice.mesh",new CubeShape(30.5f), orientation,"Mass: 20");

Yakuru

13-02-2008 13:38:09

Yes i will use this, i see that setGlobalOrientation can't work with static object.

(i create a new thread on an other little question)