scaled node collision 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
jidijaat
Posts: 7
Joined: Tue Mar 31, 2009 7:33 pm

scaled node collision problem

Post by jidijaat »

i am getting selected scenenode from this function..

selectedSceneNode = smgr->getSceneCollisionManager()->getSceneNodeFromCameraBB(cam);

//for testing i am setting light off
if ( selectedSceneNode )
{
selectedSceneNode->setMaterialFlag(video::EMF_LIGHTING, false);
}

but when i scale my nodes like
node->setScale(vector3df(10,10,10));
this function does not detect this node.

what to do.....
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess you should use selectedSceneNode
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

jidijaat how do you create your node? Is it a AnimatedMeshSceneNode or a MeshSceneNode? Maybe you have to update the boundingbox after scaling your node.
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, bbox is automatically scaled. Only vertex changes would require a manual update.
jidijaat
Posts: 7
Joined: Tue Mar 31, 2009 7:33 pm

Post by jidijaat »

i am using meshscenenode. bounding box is showing properly in debugdraw.
but collision is not happning. it happens sometime when i go inside the mesh, but not everytimes. when i stopped scaling the mesh i do properly
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

jidijaat can you create a very small test.cpp which can be directly compiled? I want to take a closer look at this phenomen.
darkunderlord
Posts: 1
Joined: Wed Apr 22, 2009 2:46 pm

Post by darkunderlord »

anyone figure this out? I'm seeing the same thing with my scaled nodes. They sort of work but there's also problems with the floor planes I have below causing bounding box problems or something.

Others have said something similar to what I've seen and different SVN's aren't helping me. I'm trying the triangleselector way now, but these objects are stationary. It's a kind of chess game where you click on the piece and then the square you want to move to.

ugh. Irrlicht rocks though!
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

hybrid wrote:No, bbox is automatically scaled. Only vertex changes would require a manual update.
Is the bbox scaled as soon as node->setScale is called? Or is it scaled when the node is next updated? I've certainly had issues where I'd have to call node->OnAnimate(0) or node->updatedAbsolutePosition() in order to then get the correct bbox back from a node directly after scaling.
Image Image Image
Post Reply