Sign in to follow this  
makuto

Collision resolution with an SAT based method

Recommended Posts

Hello. I have successfully implemented a separating axis theorem-based collision detection function. My problem is with resolving the collision. By following this tutorial,
http://www.metanetsoftware.com/technique/tutorialA.html
he says that all I have to do is resolve the collision using the axis with the shortest possible resolution vector. This doesn't work at all when the objects near each other's corners, because the vector on the other side of the corner (the incorrect vector) will be shorter, making the object tunnel through the corner. I've done 3 multisampled levels on a slower-moving object, and it still tunnels straight through.
I have tried a key-based system where if the object travels up, it will resolve down. This works except when it comes to diagonals. I use the square of 2 as a 45 degree angle for the resolution axis, but the object ends up traveling too far in order to resolve the collision.
What is a good collision resolution technique that I can use to solve the collisions?

Share this post


Link to post
Share on other sites
All discrete methods will be subject to tunneling. There's no way around it. When it comes to physics libraries (Bullet in particular), they prevent this by internal sub-steps or by having a threshold over which they enable sweeping - continuous collision. This involves Minowski sums as far as I've understood and let me tell you they are a world of [i]phun[/i].
So in general, it appears no algorithm solves the high-speed case natively (whatever high-speed means to you).

I'm probably pissing off quite some people but... look at a physics library for doing the work for you.

Share this post


Link to post
Share on other sites
Thanks for the response. I think I will try something like the object's centers at the beginning of the frame are compared to the static object's normals, then the closest normal to the line will be used.
Performance matters, but right now I'm just coding it to be fairly versatile and to work, as well as for a learning experience (which is the main reason why I don't use a lib).

Share this post


Link to post
Share on other sites

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