A Problem with: getSceneNodeFromRayBB()

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
spyro
Posts: 17
Joined: Mon Mar 14, 2005 4:05 pm

A Problem with: getSceneNodeFromRayBB()

Post by spyro »

Hi!

I have some problems with this code:

Code: Select all


position2d<s32> MausPos;
MausPos = device->getCursorControl()->getPosition();
              
line3d<f32> linie = smgr->getSceneCollisionManager()->getRayFromScreenCoordinates(MausPos, smgr->getActiveCamera());
objekt = smgr->getSceneCollisionManager()->getSceneNodeFromRayBB(linie, 0);
... because i can only select a mesh after the fifth or sixth click.
Is anybody able to help me? (Sorry for my English :-)

-spyro-
tip
Posts: 50
Joined: Fri Feb 13, 2004 8:53 am
Location: grenoble, France
Contact:

Post by tip »

try ISceneNode::setDebugDataVisible(true)
when the Bounding box will be visible, i think you'll understand better why it doesn't work. Usually it's due to invalid BBox.

Something happening sometimes is having such a problem with a "Custom" scene node, where you build you own object built on a triangle list. For this objects you're responsible for making the BBox (adding all the points). As the Draw() method is overloaded, it won't display the bounding box. Then you need to write something like this to see it :

video::SMaterial m;
m.Lighting = false;
driver->setMaterial(m);
driver->draw3DBox(Box, video::SColor(0,255,255,255));

replacing "Box" with your aabb object

hope this helps
Post Reply