Moving Raycast

capture

30-07-2007 17:54:38

I need a ray that shoots out the front of my car. I am currently using this code

Ogre::Vector3 pos, endpoint;
Ogre::Quaternion orient;
m_chassis->getPositionOrientation(pos, orient);
endpoint = pos + 50;
OgreNewt::BasicRaycast ray(mWorld,pos,endpoint);

But i was wondering how would i constantly update the ray like every frame with new positions? Would i just call ray(mWorld, newcarpos, newendpoint)?

walaber

30-07-2007 20:14:24

just run the above code every frame...