Hey All , Hope You are doing fine...
Guys can any one tell me how to check collision between two scene nodes ???
[Solved] Collision Between Scene Nodes
[Solved] Collision Between 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
-
- Posts: 1186
- Joined: Fri Dec 29, 2006 12:04 am
Re: Collision Between Scene Nodes
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.
If you want to use bullet, you have to check collisions in a simulation tick callback. In this case, check Collision Things, too.
"Whoops..."
Re: Collision Between Scene Nodes
You may also do it in a simple way by checking the bounding boxes of 2 nodes:
Regards
smso
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));
}
smso
Re: Collision Between Scene Nodes
@smso works great thanks man ....
When it's all over, it's not who you were. It's whether you made a difference