• Advertisement

Archived

This topic is now archived and is closed to further replies.

Simple collision detection between 2 mesh?

This topic is 5063 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
I have not tested this yet, but try it. Its in the SDK and should work.

3DXIntersect



~Guyaton

Share this post


Link to post
Share on other sites
If you only want to test IF they collide, then you need to do:

1) [preprocess] Build a bounding volume to approximate the mesh. The more specific your bounding volume, the more specific your collision detection gets. Simplest would be a sphere, more complex would be an OBB tree several layers deep. If you want triangle to triangle collision, you''ll need to generate the triangles of your mesh (they are not part of the .x file format, if that''s what you''re using)

2) [runtime] Check the bounding volumes of the meshes against each other. If you want triangle to triangle collision, then you''ll probably need to be using OBB trees, check the collision between them and check triangle collision from colliding leaf nodes.

The simplest way is to use bounding spheres and not care about tri-tri collision, but this is not very accurate for both collision detection and collision response. The more complex is to use OBB and deal with tri-tri collisions, which gives the most accurate results for both detection and response.

Check out the Collision Detection Demo on my website at http://gamestudies.cdis.org/~segall . It''s pretty much what you''re asking for. But keep in mind it''s around 2 months old, and I have since made several improvements (including collision response), but it should give you a good idea.

Share this post


Link to post
Share on other sites
You should read this article, too. Especially if you want to do more than simple bounding-box or bounding sphere collision.

Share this post


Link to post
Share on other sites

  • Advertisement