get position

danharibo

31-05-2006 11:21:45

How can i get the body's position?
would i have to modify ogre newt?
or is there an easyer way?

abecam

31-05-2006 12:29:33

You have a method for that in Body:

void Body::getPositionOrientation( Ogre::Vector3& pos, Ogre::Quaternion& orient )

Hope it helps!

danharibo

31-05-2006 12:39:18

im aware of that function, but i want its position not pos and orient

abecam

31-05-2006 12:54:53

I must admit I don't understand :shock: , you get with this method the position and the orientation... I f you don't need the orientation, you don't have to use it. Or do you want something else? (you can also get the OgreNode attached to that body and then get the position from there)

danharibo

31-05-2006 13:36:18

ok, i have a node now, thanks :)

walaber

01-06-2006 02:20:50


Ogre::Vector3 pos;
Ogre::Quaternion orient;

body->getPositionOrientation( pos, orient );

// use the position here, ignore orientation if you don't need it.

danharibo

01-06-2006 18:21:32

thanks, walaber, but the node is very usefull.