there are a lot of GetSceneNodeFromScreenCoordinatesBB-Threads out there but I didn't find an answer for my question:
I try to use it to detect the selection of billboards with the mouse cursor. However, the function mostly returns null allthough the mouse is over one of my billboards. I call it with every mouse event. I checked the mouse position, it's correct. I use the standard viewport. If I move the mouse over my billboard very often, it sometimes returns my scenenode. Why does the function mostly return null and sometimes my billboard scenenode?
Code: Select all
public bool OnEvent(Event e)
{
switch (e.Type)
{
case EventType.KeyInput:
KeyInput(e);
break;
case EventType.MouseInput:
MouseInput(e);
break;
}
return true;
}
private void MouseInput(Event e)
{
mousepos = e.MousePos;
Console.WriteLine(mousepos.X+";"+mousepos.Y);
ISceneNode selnode = scene.SceneCollisionManager.GetSceneNodeFromScreenCoordinatesBB(mousepos, 0);
if (selnode != null)
{
selectednode = selnode;
Console.WriteLine(selectednode.Name);
}
}
i'm sorry about my bad english