Bounding Box and Selection.

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
megalomania666
Posts: 12
Joined: Thu Mar 30, 2006 2:18 pm
Location: Sweden
Contact:

Bounding Box and Selection.

Post by megalomania666 »

Hello,

I have this problem with picking scene nodes

Sceen Shot : http://www.megalomania666.com/xjobb/bound.JPG

As seen on the screen shot I can only select the wall at the upper part of it.

I have been looking around for quite some time in the forum or an answer to this now. I suspect it´s a bounding box problem and I have changed aabbox3d.h, line 136 to :

Code: Select all

const vector3d<T> e = getExtent() * (T)0.5;
with no result.

I have tried both

Code: Select all

smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(camera);
and

Code: Select all

core::dimension2d<s32> pos;
pos.Width = device->getCursorControl()->getPosition().X;   
pos.Height = device->getCursorControl()->getPosition().Y;
selectedMesh = smgr->getSceneCollisionManager()->getSceneNodeFromScreenCoordinatesBB(
core::position2d<s32>(pos.Width,pos.Height),0);
And they both find the wall at it´s upper part.

Is my only hope the irr::scene::IMetaTriangleSelector* now?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

what kind of scene node/mesh do you use? The patch to aabbox.h is not necessary with latest Irrlicht 1.0, so which version do you use?
megalomania666
Posts: 12
Joined: Thu Mar 30, 2006 2:18 pm
Location: Sweden
Contact:

Post by megalomania666 »

Hi Again Hybrid!

I use the following code for the meshes

Code: Select all

scene::IAnimatedMesh* floorMesh = smgr->getMesh("floor_uno_floor.3DS");
scene::IAnimatedMesh* wallMesh = smgr->getMesh("floor_uno_walls.3DS");
	
scene::ISceneNode* floorNode = smgr->addAnimatedMeshSceneNode(floorMesh , NULL, 10);	
scene::ISceneNode* wallNode = smgr->addAnimatedMeshSceneNode(wallMesh , NULL, 11);	

And irrlicht-0.14.0
Post Reply