Ray Query always returning (0,0,0) Vector

Dr.Fix

17-12-2006 11:20:27

Hi,

I ave a problem with Ray Query.
Every time I click on any mesh I get 0,0,0 as intersection....


this is the portion of code.
I'm not using it in a window so I don't need to divide e.X, e.Y by window size (I also tried it but I get no result with it).

Ray mouseRay = mCamera.GetCameraToViewportRay(e.X, e.Y);
mRaySceneQuery.setRay(mouseRay);

// Execute query
RaySceneQueryResult result = mRaySceneQuery.execute();
RaySceneQueryResult.RaySceneQueryResultEnumerator itr = result.GetEnumerator();

// Get results
if ( itr != null && itr.MoveNext() )
{

Vector3 ClickPoint = itr.Current.getWorldFragment().getSingleIntersection();
SetCustomTempOverlayCaption(0, 5, "Click in x:" + ClickPoint.x + " y:" + ClickPoint.y + " z:"+ ClickPoint.z);

}