#### Archived

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

# 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.

## 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 on other sites
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

##### Share on other sites
*double post*

[edited by - oliii on May 8, 2004 5:38:59 PM]

1. 1
Rutin
37
2. 2
3. 3
4. 4
5. 5

• 9
• 12
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
633348
• Total Posts
3011459
• ### Who's Online (See full list)

There are no registered users currently online

×