Sign in to follow this  

Rotational Collision Detection in 2D

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

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites

This topic is 3858 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this