GetSceneNodeFromScreenCoordinatesBB on Billboard mostly null

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
NewYoda
Posts: 4
Joined: Sat Sep 17, 2005 11:28 am
Location: Thüringen

GetSceneNodeFromScreenCoordinatesBB on Billboard mostly null

Post by NewYoda »

Hi,

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);
            }   
}
tia



i'm sorry about my bad english
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

It looks like the .NET version still has some problems. I'm going to fix it, and rewrite the original function anyway for the next release.
Guest

Post by Guest »

THX!

is there any workaround I can use until the next release?
NewYoda
Posts: 4
Joined: Sat Sep 17, 2005 11:28 am
Location: Thüringen

Post by NewYoda »

oh, I forgot to login...
btw my BillboardSceneNode's Bounding Box is allways 2x2x2
Locked