Sign in to follow this  
elias4444

AABB vs Sphere Collision Handling and Response

Recommended Posts

Ok, I've got collision response figured out for sphere vs sphere stuff. Find the differing vector and back them up so they no longer overlap... and then I'm free to do whatever bounce-friction-goofiness I feel like. Even a sphere vs a line-wall is easy to figure out. BUT, I'm having some serious issues with AABB vs Sphere (and AABB vs AABB for that matter) collision handling. I can detect a collision no problem, but can't seem to back the objects out of each other correctly (the vector length from center point to center point changes for every direction since it's a cube instead of a sphere). What's an easy (and optimal) way to handle this? Please use code snippets to help explain the answer, and please don't use the word "simply," as I've learned that it's the "simply" part that I'm usually missing. ;) Any help is appreciated though!

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