#### Archived

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

# Collision System

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

## Recommended Posts

I''m writing a spherical collision system. I''m testing against surface, edge, and points for each triangle. I''m having a problem determining what type of collision occurs based on the sphere colliding with multiple things. A simple example, I have a square made out of 4 polygons. Each poly connects at a point in the middle of the square. When the sphere hits near the center, I register 4 or 5 collisions -- a point, a couple edges, a couple surfaces. It just so happens that the point is registered as the nearest collision so I bounce off of that point. Obviously, the entire thing should be treated as just a surface. The question is how to determine when a point and edge collision are REALLY what I need to collide with (like at a corner) rather than a surface collision. I''ve tried a couple different things like dealing with every collision as if it were a surface but the sphere would fall through edges at times (like at steps, or ledges) because of this. There''s got to be a fairly simple solution to this. I think I''m just looking at it too literally when I''m thinking of each type of collision. Maybe I need to do some sort of preprocessing to throw out invalid collisions (like the middle point, and every internal edge in the example above)? Does anyone know of an easy way to deal with this?

##### Share on other sites
it''s a tricky subject, especially when the sphere is deeply embedded into the geometry. I hacked it in a collision system by filtering the collisions as they occurs.

Say a point collision occurs, but there was already a triangle-plane collision, and the point belong to the triangle. In that case, I''ll throw away the point collision. Same for an edge. If a triangle plane has the edge, and the triangle plane already collided, throw away the edge collision. ect... By filtering like that, you throw away a fair amount of collisions, but it''s far from perfect. It works OK if the sphere is not too embedded.

The best way to detect collisions is to introduce linear velocities. Then, you only process one contact at a time, to the expense of running the algoritm several times per frame, and with tricky special cases when the velocity is 0.

If anyone as a good algorithm for interference detection, I''m all ears too.

##### Share on other sites
I''m collecting all the collisions for a specific timestep and then try to determine the collision from that. So, I could remove any points/edges if they''re part of a poly that also had a surface collision. I''ve tried evaluating the collisions I''ve collected in similar ways but, like you said, it''s far from perfect.

There''s gotta be a fairly straightforward way to determine actual collisions -- I just can''t think of it. Certainly someone here has dealt with this issue.

1. 1
Rutin
24
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 38
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631706
• Total Posts
3001835
×