RayQueryResult contains (-1, -1, -1)

Dale_ee

20-09-2006 17:38:57

When I do SceneQueries on my terrain I sometimes get (-1,-1,-1) intersection point, though camera is above correct tile, and mouse is pointing at correct tile too.
This problem occurs spontanously, and not really often, but I want to find a reason why this is happening. Down the sources I found, that Vector3(-1,-1,-1) is returned when rayStart isn't above/below terrain tile, so I added DebugText showing me current Page and current Tile on this page.
All the page/tile information was correct, so I couldn't trace the error :(
I use precompiled dll and lib files, so I can't debug it normally. Maybe it's time to add PLSM2 project to my solution :roll:

tuan kuranes

20-09-2006 17:41:30

You need to debug that yourself or try to find reproducable steps so that I can trace the bug...

Dale_ee

20-09-2006 17:56:14

Yep, i figured that already out :wink:
Now trying to add PLSM project, it's not easy, because I want my solution to be stand-alone...

Dale_ee

20-09-2006 18:27:16

Well, problem occurs here:


if (ray.x < leftBorder && mNeighbors[ WEST ] != 0 && mNeighbors[ WEST ]->isLoaded())
return mNeighbors[ WEST ] ->intersectSegmentFromAbove(ray, dir, result);
else if (ray.z < topBorder && mNeighbors[ NORTH ] != 0 && mNeighbors[ NORTH ]->isLoaded())
return mNeighbors[ NORTH ] ->intersectSegmentFromAbove(ray, dir, result);
else if (ray.x > rightBorder && mNeighbors[ EAST ] != 0 && mNeighbors[ EAST ]->isLoaded())
return mNeighbors[ EAST ] ->intersectSegmentFromAbove(ray, dir, result);
else if (ray.z > bottomBorder && mNeighbors[ SOUTH ] != 0 && mNeighbors[ SOUTH ]->isLoaded())
return mNeighbors[ SOUTH ] ->intersectSegmentFromAbove(ray, dir, result);
else
{
if (result != 0)
* result = Vector3(-1.0f, -1.0f, -1.0f);

return false;
}


Some neighbors have mLoaded = false, though I see all the tiles on screen and have "LoadNow" option turned on.

tuan kuranes

21-09-2006 15:16:33

I'll try to have a look, at reproducing that...