problem with StackOverflowException when using rayscenequery

Chulein

23-09-2008 13:35:59

Hello.


Im having a problem when using the RaySceneQuery execute() method.

I got a program where i can mousepick objects on a flat terrain, and also i get the exact position on the flat terrain. to do this i use the ray pick example.


similar code.

float scrx = (float)e.X / Viewport.ActualWidth;
float scry = (float)e.Y / Viewport.ActualHeight;

Ray ray = mCamera.GetCameraToViewportRay(scrx, scry);

RaySceneQuery query = mSceneMgr.CreateRayQuery(ray);
query.SetSortByDistance(true);

RaySceneQueryResult result;
result = query.Execute();
itr = result.Begin();



this is currently working great in the program, but the following error occured as i wanted to move on and use the terrainmanager
" scenemanager.SetWorldGeometry("terrain.cfg") ".

mousepicking and coordinate updates still works great when loading "terrain.cfg". but the problem occurs when i navigate close to the ground terrain, and an ray shoots out into the "sky/nothing/empty". I think its because the "camera" is inside the "terrains" bounding box or something, because its not a problem if i use ray into nothing when im far away from the terrain.cfg..

i get the message:

An unhandled exception of type 'System.StackOverflowException' occurred in Mogre.dll

on line:

result = query.Execute();

Im using VS Pro 2005 /C# Express 2005
Mogre 1.4.6


anybody knows how to fix this?

Thanks:)

koirat

30-10-2008 07:11:15

using(mSceneMgr.CreateRayQuery(new Ray()))
{
}


Inside frame listener is throwing out of memory exception after some time. If you look at manager during execution, the memory is growing and is not disposing. Also ClearResult() is not helping at all.

Chulein

30-10-2008 09:54:36

This problem has been annoying me for weeks.
Now it works great! Many Thanks! :D

Chulein

30-10-2008 11:45:17

I think i was a little quick to do the victory dance :) It still dont work.
Can you explain abit more?