Problem with terrain ray query [Solved]

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Problem with terrain ray query [Solved]

Post by lonewolff »

Hi Guys,

I am having trouble detecting if a ray is hitting a terrain.

I have this but it never returns '1' to say that contact had been made.

Code: Select all

Ray mRay(Ogre::Vector3(x,y,z),Vector3::NEGATIVE_UNIT_Y);
mRaySceneQuery->setRay(mRay);

TerrainGroup::RayResult rayResult=mTerrainGroup->rayIntersects(mRay);
if(rayResult.hit)
{
	return 1;
}
x & z are the players position and for y I am just using 1000 (to make sure that the ray starts well above the terrain.

Any help would be appreciated.

[Solved]
Bloody GameMaker: Studio wasn't seeing the return result from my DLL. :roll:
Post Reply