ahmadi
17-08-2006 12:58:21
Hi
i have a map(level), its group of ogre meshs, now i can not raycast with ogre for giving Y position of raycasting on my map surface, its my code but it only can return baundingbox colision and no more about mesh:
i have a map(level), its group of ogre meshs, now i can not raycast with ogre for giving Y position of raycasting on my map surface, its my code but it only can return baundingbox colision and no more about mesh:
float givey(float x,float z)
{
static Ray updateRay;
updateRay.setOrigin(Vector3(x,1000,z));
updateRay.setDirection(Vector3::NEGATIVE_UNIT_Y);
raySceneQuery->setRay(updateRay);
RaySceneQueryResult& qryResult = raySceneQuery->execute();
RaySceneQueryResult::iterator i = qryResult.begin();
if (i != qryResult.end() && i->worldFragment)
{
SceneQuery::WorldFragment* wf = i->worldFragment;
return (i->worldFragment->singleIntersection.y);
}
}