# Rotational Collision Detection in 2D

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

## Recommended Posts

My game has objects which are convex polyhedra that collide with other objects as well as the map (line segments). I am currently using the continuous SAT test to detect collisions and react to them. However, I'd like the objects to be able to rotate as well. Is there a way to extend the SAT test so that it takes an angular velocity as well as translational, or do I need a different algorithm? I'm having trouble finding material on the subject.

##### Share on other sites
When you have only constant linear velocity, the tests for overlap of intervals of projection onto a potential separting axis involves simple algebra. When you throw in angular velocity, the tests involve finding roots of complicated expressions. Finding the roots will be the bottleneck in using SAT in this setting.

##### Share on other sites
What method do most people use when they need to do rotational collisions in 2D?

I have been trying to fake rotational collisions by rotating, then doing a static SAT test, and then pushing the polygon out of the offending edge(s), but this only works for slow rotations and when the static test reports more than 2 colliding edges the behavior becomes unclear (at least to me). If I could come up with a way to figure out which edge(s) collided first in this case and how to handle it, I'd be happy without the continuous rotational test.

Any suggestions?

##### Share on other sites
if the objects rotate really quickly, I'd slice the time interval into smaller intervals (so that the angular displacement is within a threshold) and do tests using a swept linear SAT.

##### Share on other sites
Using swept-point-vs-swept-lineseg, you can sweep the convex verts of one poly vs the edges of the other (and vice versa), however:
-this is still an approximation: features should move along curves, however the sweep test moves them along straight lines
-it's not clear how to respond to the results (unless you're using a back-up-to-time-of-collision method)

In the end a more practical "solution" might be to clamp angular velocity and/or multisample to keep the angular movement small.

##### Share on other sites
That seems like a good idea oliii. Is that how you do it in your rigid body dynamics tutorial (#7 in PollyColly)?

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

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

• Total Topics
631710
• Total Posts
3001845
×