I'm trying to figure out, is there an easy way to test if a mesh intersects with another, like you do with a aabbox class.
Do I need to create triangle selectors? I also need to get the center point of the collision.
Collision detection, need some help
Re: Collision detection, need some help
That's pretty much what Irrlicht does offer when it comes to collision handling: http://irrlicht.sourceforge.net/docu/cl ... nager.html
You can see there which functions need an ITriangleSelector. The collision animator in Irrlicht just uses those functions.
So no - exact mesh-vs-mesh collisions are not offered. I think I discussed a little more about this in the forum once with some ideas how to implement that, but the most important part is that when you are doing games you don't need that. At least not yet, maybe some day it will change, but for now pretty much every game uses the same trick and uses simpler forms like boxes or spheres or ellipsoids around the real model and does collide with those. Real mesh-vs-mesh collision is still rather expensive (although it might work by now by using a very simplified collision model, so maybe some games already do that). And the ellipsoid/bounding box solutions just turned out to be good enough to be accepted by players so far.
If you really want mesh-vs-mesh (for example because you want to advance the state of the art or because you are not doing a game) then I think the best solution for now is using a collision library, I think every physics engine has one of those included.
You can see there which functions need an ITriangleSelector. The collision animator in Irrlicht just uses those functions.
So no - exact mesh-vs-mesh collisions are not offered. I think I discussed a little more about this in the forum once with some ideas how to implement that, but the most important part is that when you are doing games you don't need that. At least not yet, maybe some day it will change, but for now pretty much every game uses the same trick and uses simpler forms like boxes or spheres or ellipsoids around the real model and does collide with those. Real mesh-vs-mesh collision is still rather expensive (although it might work by now by using a very simplified collision model, so maybe some games already do that). And the ellipsoid/bounding box solutions just turned out to be good enough to be accepted by players so far.
If you really want mesh-vs-mesh (for example because you want to advance the state of the art or because you are not doing a game) then I think the best solution for now is using a collision library, I think every physics engine has one of those included.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Collision detection, need some help
Thank you. I'll take a look at that.
Yeah, I think I'll try bbox method instead.
I have another question, if I'm making a platformer type game, do I need to call createCollisionResponseAnimator method of the scene manager for every objet?
I'm sort of confused width multiple animators.
What if there are multiple platforms? Do I also need to create multiple triangle selectors?
Yeah, I think I'll try bbox method instead.
I have another question, if I'm making a platformer type game, do I need to call createCollisionResponseAnimator method of the scene manager for every objet?
Code: Select all
anim = smgr->createCollisionResponseAnimator(terrainTriangleSelector, objectNode1);
objectNode1->addAnimator(anim);
anim = smgr->createCollisionResponseAnimator(terrainTriangleSelector, objectNode2);
objectNode2->addAnimator(anim);
anim = smgr->createCollisionResponseAnimator(terrainTriangleSelector, objectNode3);
objectNode3->addAnimator(anim);
....
What if there are multiple platforms? Do I also need to create multiple triangle selectors?
Re: Collision detection, need some help
cloth simulations need mesh vs mesh collisions, for instance.
But for a character moving for an scenario, you only need a triangle selector for the scenario, and all the other moving objects (characters and such) can use a collision response animator. So, answering your question, yes, you would need a collision response animator for each object you want to collide with the stage.
But for a character moving for an scenario, you only need a triangle selector for the scenario, and all the other moving objects (characters and such) can use a collision response animator. So, answering your question, yes, you would need a collision response animator for each object you want to collide with the stage.
Last edited by Mel on Wed Sep 26, 2012 8:39 am, edited 1 time in total.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Collision detection, need some help
Thank you Mel.
So the engine actually uses bounding box of the scene node to do collision detection, right?
I think that is sufficient for me.
So the engine actually uses bounding box of the scene node to do collision detection, right?
I think that is sufficient for me.
Re: Collision detection, need some help
The collision animator is using ISceneCollisionManager::getCollisionResultPosition, so it is using an ellipsoid. For typical shooter-controls that usually works better.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm