# Collision contact processing

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

## Recommended Posts

Hi all, Moving slowly on with my physics :o Related to my other question about multiple contacts in coldet... Wondering about the case where e.g. something collides with a wing on an aircraft. The problem being that this will result in two collisions: one with the top poly and one with the bottom, both normals being almost opposite one another. How could the collision response handle this?! Calc the average normal from all contact surfaces? Or maybe 'collide' with the edge between them?!

##### Share on other sites
If your objects move fast enough that they travel a significant fraction of the size of the smallest object, you need to do swept collision tests. This might be a matter of subdividing your collision detection, so you do overlap tests between the pair of old positions, then the pair of positions 10% between the old and new positions, etc. In this way your first collision you find would be with the leading edge of the wing, and the normal would be in the correct direction.

A cheaper, hackier solution might be that when you detect that your normals are really inconsistent with either each other, or the relative motion of the two colliding bodies, you assume that the two objects are intersecting so much you can use some guessed collision normal.

##### Share on other sites
yeah, as a simple check, make sure the velocity is going towards the collision normal. If not, it's probably a back poly.

*BUT*, that can introduce bugs. Better, calculate the velocity at the contact point instead of just the velocity of the body.

##### Share on other sites
MrRowl: that would presumably mean I need edge info from the coldet lib, not just poly collisions?!

Oli: Time to add angular stuff to my engine!

Hmm - definitely looks like I need a better collision detection library!

##### Share on other sites
Quote:
 Original post by Aph3xMrRowl: that would presumably mean I need edge info from the coldet lib, not just poly collisions?!

No - when I said "leading edge" what I meant was "all the polygons that make up the leading part of the wing" - i.e. I didn't mean edge in the 'technical' sense!

You should still be able to approximate swept collisions by subdividing - try that before giving up on your existing collision detection library, since it should be a fairly simple thing to do.

##### Share on other sites
Ah I see :) Well, my coldet lib only returns one collision poly per model, so I can't efficiently get all collisions.
Time to try OPCODE I think.

Thanks for the help Rowl/Olii

1. 1
2. 2
Rutin
21
3. 3
4. 4
frob
17
5. 5

• 9
• 12
• 9
• 33
• 13
• ### Forum Statistics

• Total Topics
632591
• Total Posts
3007250

×