get the position of an ogrenewt body

rekotc

12-07-2010 13:43:37

im still reading the basic tutorial, i understand that if i get an ogre node and i move it:

Ogre::SceneNode* node = scnMgr->getSceneNode("Bumpcar2");
node->setPosition(Ogre::Vector3(move,2.0f,move));


the rigid body connected to it wont move, so how can i get the ogrenewt body for moving it? i hope it's clear..thanks!

koirat

12-07-2010 17:55:06

When you create Newton body you attach scenenode to it but you have the physic body so you can set position and orientation.
What you have shown us is just SceneNode without a OgreNewt Body .

kallaspriit

12-07-2010 21:30:23

OgreNewt::Body::setPositionOrientatio(Vector3 position, Quaternion orientation)

Notice that you should use it only to position the body to it's starting location, not to move it around and hope collision detection and proper physics still to work.