Page 1 of 1

Bounding Box and Selection.

Posted: Sat May 20, 2006 10:41 am
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?

Posted: Sat May 20, 2006 11:52 am
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?

Posted: Mon May 22, 2006 2:33 pm
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