Jump to content
  • Advertisement

Archived

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

Erik Sintorn

Managing collisions by projection

This topic is 5305 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

I am writing a collission detection engine based on the paper "Advanced Character Physics" by Thomas Jakobsen. In this he describes how a rigid body can be represented by four particles and six stick constraints. Collissions are handled simply by finding any particle that has crossed a boundrary (in the examples in the paper, no particle can be outside a specified box) and projecting it back inside. This is all fine when the constraints are as simple as keeping a particle in a box, but what I want to do is to keep an arbitrary closed mesh outside any other closed mesh. I do this now by building an aabb-tree of each mesh, and check each tree against any other tree. If two leaf nodes are found to collide (each leaf contains only one triangle), the following is done: For both triangles: For each vertex of triangle: Shoot a ray from the vertex in the direction of it''s negative normal. If it hits the other triangle the intersection point is found and the vertex is moved to that point. This seems to work, but it''s terribly slow. What I would really like, i guess, is some simple and fast method that takes two triangles and finds the shortest distance (and direction) that one of them needs to be moved so that they won''t intersect anymore. Could anyone help me? Erik Sintorn

Share this post


Link to post
Share on other sites
Advertisement
I''ve been tinkering with this idea. One way I use for finding the collision depth of convex objects (mainly box/box, but works for triangle-box and triangle-triangle), is use the separating axis test, but extended slightly. The MTD (minimum translational distance), which is what you are looking for, can be found by taking the minimum overlap distance between all the axes. That will give you a normal and a depth. So basically, that''s the direction of movement, and the depth you need to translate your triangles. You may have to invert the direction, since the direction of the separating axis is pretty much random.

I''d like to try the idea, once I''ve got time. It''s basically setting up a 4-vertex frame, and using the MTD of two intersecting triangle, push the frames away so they stop intersecting. They should rotate, as well as bounce. One major problem, is to find the right size and shape of the frame (tetrahedron), which would ultimately simulate the inertia of the body.

I have a demo, which is based roughly on that idea, except that I only check vertices at the moment, and I generate a temporary constrain from the collision point and add it to a list. I don''t use a set of linear equations to calculate the weights at the vertices of the shape. So, slightly different method.

http://uk.geocities.com/olivier_rebellion/heightmap.zip

you may have to download it from the main page.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!