Render Rays?

capture

27-07-2007 20:30:58

I was wondering if there is an easy way to render a basicraycast for debugging purposes?

Horizon

30-07-2007 09:50:15

With a ManualObject.


someManualObject->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_LINE_LIST );
someManualObject->position(someRay->origin);
someManualObject->position(someRay->position(someDistanceFromTheOrigin));
someManualObject->end();


Then attach this object to a sceneNode.

walaber

30-07-2007 20:16:16

yup. in the case of an OgreNewt raycast, you have a start and end point in global space, so you can change it to this:


someManualObject->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_LINE_LIST );
someManualObject->position(startPt);
someManualObject->position(endPt);
someManualObject->end();