Collision Detection: .obj mesh vs. Q3 Bsp

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
fitfool
Posts: 20
Joined: Sun Jul 15, 2007 5:40 am

Collision Detection: .obj mesh vs. Q3 Bsp

Post by fitfool »

Hi, im sorry if this is a widly asked question but does anyone know of a tutorial which will show me how to implement collision detection with a mesh(.obj) versus a quake 3 map? thanks;
SwitchCase
Posts: 170
Joined: Sun Jul 01, 2007 11:41 pm
Location: Manchester, UK

Post by SwitchCase »

Try the collision tutorial you get with Irrlicht. It's also on the main website. If you need better collision get a physics engine (Newton, Ageia, etc.). The format of your meshes is irrelevent by the way, as long as you can load them into Irrlicht.
fitfool
Posts: 20
Joined: Sun Jul 15, 2007 5:40 am

Post by fitfool »

Ive taken a look at those, but i dont see a way that i can tell if it has collided with something. How can i tell if it has so i can do a explosion/stuff like that.
Thank's
fireside
Posts: 158
Joined: Thu Dec 01, 2005 10:55 pm

Post by fireside »

I'm just an absolute beginner here, but I think if you look at how the material lighting changes with the fairy, that's how you get collision for an object other than the static geometry. It's not extremely accurate, so you'd have to use a physics engine if you wanted more accuracy.
teh_fabs
Posts: 4
Joined: Sun Jul 15, 2007 8:57 pm

Post by teh_fabs »

In the tutorial, just replace

selector = smgr->createOctTreeTriangleSelector(

with

selector = smgr->createTriangleSelector(

Hope that works.
fitfool
Posts: 20
Joined: Sun Jul 15, 2007 5:40 am

Post by fitfool »

ok cool, i have the collision detection working, but i need to see were it hit the object its colliding with. Any help?

thanks :idea:
Last edited by fitfool on Mon Jul 16, 2007 6:46 am, edited 1 time in total.
fitfool
Posts: 20
Joined: Sun Jul 15, 2007 5:40 am

Post by fitfool »

And this is how im doing it.

Selector = Globals::SceneMgr->createOctTreeTriangleSelector( Globals::Map->getMesh(0), Globals::MapNode, 128 );
Globals::MapNode->setTriangleSelector( Selector );

ISceneNodeAnimator *Collision = Globals::SceneMgr->createCollisionResponseAnimator( Selector,
RocketNode,
vector3df(25, 25, 25),
vector3df(0, 0, 0),
vector3df(0, 0, 0) );

RocketNode->addAnimator( Collision );
Collision->drop();
Selector->drop();
Post Reply