We use a lot of ray querying in our game, and most of the time it works great. However, we've stumbled onto a few cases where it seems that it doesn't work correctly.
1) Casting rays against terrain sometimes returns (among other things) a queryResult where the fragment type is 6. Looking at the docs, it doesn't make any sense:
Code: Select all
Enumeration values:
WFT_NONE Return no world geometry hits at all.
WFT_PLANE_BOUNDED_REGION Return pointers to convex plane-bounded regions.
WFT_SINGLE_INTERSECTION Return a single intersection point (typically RaySceneQuery only).
WFT_CUSTOM_GEOMETRY Custom geometry as defined by the SceneManager.
WFT_RENDER_OPERATION General RenderOperation structure.
2) Query returns [] (empty list of results) when the ray begins over the terrain AND the scene nodes in its path are over the rays position.
This really makes me go "WTF!"

When I'm under the terrain max height limit, the ray casting works perfect. I can shoot a ray (using Camera::getCameraToViewportRay) at anything and it will be in the list.
However, when I'm above the max height value of the terrain, it seems only scene nodes that are below me is in the list that gets returned.
I use the basic Terrain Scene Manager, and I call getCameraToViewportRay with screenx = screeny = 0.5 (the middle of the screen).
Does anyone recognize this? It seems really strange. For more info, me and Clay have been discussing (1) here: http://www.ogre3d.org/phpBB2addons/view ... sc&start=0