Hello.
I have another (no doubt) stupid question. I can't figure out how to do collision detection with a mesh in my .irr file. Actually, I want it to collide with everything in that file, but I imagine I have to add a CollisionResponseAnimator for each one. I don't know how to get to those meshes from my program, however. I need them to create my TriangleSelector. Anyone know how to do this?
I am writing in C#, but any example code in C++ would be just as helpful as I'm familiar with both.
Thanks!
Collision detection with irr file
I posted some code for doing this a while back. It shows how to iterate through each element in the scene graph and generate collision information for them. It uses the Irrlicht provided collision system, but you could easily modify it to use a physics engine for collision detection.
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=19725
I added a small optimization that prevents doing per-triangle collision testing on every node. You can find that code here.
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=21015
Please keep in mind that this code is just a sample. It works, but is less than optimal and uses a very primitive collision system.
Travis
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=19725
I added a small optimization that prevents doing per-triangle collision testing on every node. You can find that code here.
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=21015
Please keep in mind that this code is just a sample. It works, but is less than optimal and uses a very primitive collision system.
Travis
-
- Posts: 5
- Joined: Thu Jan 31, 2008 7:37 pm