prath
03-07-2008 12:28:32
hi,iam not able to get the correct hit point when we click the mouse,iam writing some code that i have used
ogre::ray camray;
OgreNewt::BasicRaycast myRay(me->getWorld(),camray.origin(), camray.getpoint(1000) );
info=myRay.getfirsthit() ;
real distance=info.distance;
vector3 pos=camray.getpoint(distance);
mynode->setposition(pos);
this is the code iam usning.
when i press the mouse on the terrain i need to position the scenenode(mynode) at the ray hit position,but iam not getting the exact height at the given position, my object is placing very high on the terrain
my aim is to find the height of the terrain where we click the mouse on the entitty
help me how can i solve the problem
ogre::ray camray;
OgreNewt::BasicRaycast myRay(me->getWorld(),camray.origin(), camray.getpoint(1000) );
info=myRay.getfirsthit() ;
real distance=info.distance;
vector3 pos=camray.getpoint(distance);
mynode->setposition(pos);
this is the code iam usning.
when i press the mouse on the terrain i need to position the scenenode(mynode) at the ray hit position,but iam not getting the exact height at the given position, my object is placing very high on the terrain
my aim is to find the height of the terrain where we click the mouse on the entitty
help me how can i solve the problem