Irrlicht 1.2 & getSceneNodeFromScreenCoordinatesBB

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Magnet
Posts: 101
Joined: Wed Sep 27, 2006 7:32 pm

Irrlicht 1.2 & getSceneNodeFromScreenCoordinatesBB

Post by Magnet »

Bug with getSceneNodeFromScreenCoordinatesBB does not fixed?
Why? This bug fixed in SVN.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Irrlicht 1.2 == Irrlicht SVN rev. 319
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

What exactly is the problem that you are having? Have you read this thread?
Magnet
Posts: 101
Joined: Wed Sep 27, 2006 7:32 pm

Post by Magnet »

I am not remember revision of my CSceneCollisionManager.cpp.
Му CSceneCollisionManager.cpp: http://www.webpolit.com/irr/CSceneCollisionManager.cpp
My code works with this file but not works with IrrLicht 1.2

Code: Select all

position2di pos = device->getCursorControl()->getPosition();
hoveredSceneNode = smgr->getSceneCollisionManager()->getSceneNodeFromScreenCoordinatesBB(pos);
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

What exactly is the problem that you are having?
Magnet
Posts: 101
Joined: Wed Sep 27, 2006 7:32 pm

Post by Magnet »

Some objects in scene not detected by getSceneNodeFromScreenCoordinatesBB
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Have you tried to use the debugger to figure out why? Five seconds and a debugger or a printf would tell you if something was selected, but it wasn't what you wanted or that nothing was selected at all. A few minutes and a few breakpoints would tell you how many nodes actually were intersected by the line, and inspection would tell you what they are...

I'm willing to bet that the problem is some other node is getting selected, most likely the camera. Often, the camera will get selected when you don't use a mask. I suggest you try setting the camera id to 0 and pass a mask to getSceneNodeFromScreenCoordinatesBB to avoid picking the camera. You can pass 0xffffffff to select everything that has a non-zero id.

Travis
neotoma
Posts: 10
Joined: Tue Mar 29, 2005 9:49 am
Location: Germany
Contact:

Post by neotoma »

vitek wrote:Have you tried to use the debugger to figure out why? Five seconds and a debugger or a printf would tell you if something was selected, but it wasn't what you wanted or that nothing was selected at all. A few minutes and a few breakpoints would tell you how many nodes actually were intersected by the line, and inspection would tell you what they are...


I got also that problem. But it is not the Camera that get selected. It is the SceneNode behind my Nodes. In fact it is the Table, where i put more than 100 Pieces on the Top. It worked with Irrlicht 1.1. but not exactly enough. I changed the ColissionManager with that Patch : http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=15549. And now it works very accurate. Then i switched to Irrlicht 1.2 (without patch !) and the selection is completly wrong. I click on a piece and the table or the complete room is selected. But not that piece. So i go ahead and make the same patch as for Irrlicht 1.1 again. And now it works.....

I hope this helps.....

Mike
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Could you _please_ make a simple testcase that illustrates the problem? I have written many tests to try and reproduce the problems that users have mentioned. I have yet to find one that shows a problem.

Travis
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Actually, I don't care if it is simple or not. Just zip up and send your entire program if you don't mind.

Also, the reason my patch didn't use transformBoxEx() is that the box returned by that method is larger than the original box. This can cause picking problems when selecting some nodes. You can see the difference in the following image...

The red box is the one from transformBoxEx(). The blue one is from node->getTransformedBoundingBox(), and the green one is the object space bounding box. I think you'll agree that, for purposes of selecting, the green box is the best.

Image
Post Reply