getSceneNodeFromScreenCoordinatesBB node scaling problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

getSceneNodeFromScreenCoordinatesBB node scaling problem

Post by pera »

Irrlicht 1.5

I use getSceneNodeFromScreenCoordinatesBB to pick node in the scene.
I found out it doesn't return the node closest to the camera, but the one behind it. I tracked down problem to function "getPickedNodeBB" in SceneCollisionManager. I see that it is trying to return the node closest to the camera, but the problem occurs when node is scaled down - calculations return that it is very far from camera.

There is comment that says:
// transform vector from world space to object space
that I suspect is the problem. Why would picking line have to be transformed?? It should be constant for all objects - start and end point of line are now different for two objects.

Please can someone confirm this?
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

suggested fix:

f32 t = edges[e].getDistanceFromSQ(line.start);

should be

f32 t = edges[e].getDistanceFromSQ(ray.start);

this works for me
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, I wouldn't have thought so, but it's also that way in SVN. So jus wait for the next release where this problem is fixed.
fuego2008
Posts: 22
Joined: Wed Sep 24, 2008 7:26 pm

Post by fuego2008 »

I am having the same problem but that suggested fix didn't solve my problem :( May be mine is something different, I don't know. When I scale down my model, it becomes impossible to be selected with that function you have told
Post Reply