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.
mubashar
Posts: 63 Joined: Wed Sep 07, 2011 7:20 pm
Post
by mubashar » Wed Mar 28, 2012 2:53 pm
Hey All , Hope You are doing fine...
Guys can any one tell me how to check collision between two scene nodes ???
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
smso
Posts: 246 Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong
Post
by smso » Wed Mar 28, 2012 6:10 pm
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
Post
by mubashar » Fri Apr 06, 2012 9:50 am
@smso works great thanks man ....
When it's all over, it's not who you were. It's whether you made a difference