[Solved] Collision Between Scene Nodes

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
mubashar
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

[Solved] Collision Between Scene Nodes

Post by mubashar »

Hey All , Hope You are doing fine...

Guys can any one tell me how to check collision between two scene nodes ??? :roll:
Last edited by mubashar on Mon Apr 16, 2012 7:35 am, edited 1 time in total.
When it's all over, it's not who you were. It's whether you made a difference
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Collision Between Scene Nodes

Post by randomMesh »

If you want to use Irrlicht for collision detection, have a look at tutorial no. 7.
If you want to use bullet, you have to check collisions in a simulation tick callback. In this case, check Collision Things, too.
"Whoops..."
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: Collision Between Scene Nodes

Post by smso »

You may also do it in a simple way by checking the bounding boxes of 2 nodes:

Code: Select all

bool hasCollision(scene::ISceneNode* node1, scene::ISceneNode* node2)
{
        const core::aabbox3d<f32> box1 = node1->getTransformedBoundingBox();
        const core::aabbox3d<f32> box2 = node2->getTransformedBoundingBox();
        
        return (box1.intersectsWithBox(box2));
}
Regards
smso
mubashar
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: Collision Between Scene Nodes

Post by mubashar »

@smso works great thanks man ....
When it's all over, it's not who you were. It's whether you made a difference
Post Reply