Sign in to follow this  
THACO

Line Ellipse collision in 2D

Recommended Posts

I have been trying to do line ellipse collision in 2D with some help of the article below. http://www.gamedev.net/reference/articles/article1026.asp So I have the line and its normal. I normalize the normal then I multiple it by the ellipse radii. This should give me the collision point where the line would collide with the ellipse? but it doesn't, the pictures below show this, one is before I compenstate for the collision, and the second is the compensation, you can still see a collision. The only time the collision works is if it is at 0,90,180 or 270 degrees. It also works fine if I have the ellipse a circle. I hope I am explaining this correctly collision used to detect the collision point http://img122.imageshack.us/my.php?image=1hh0.jpg supposed resolved collision http://img243.imageshack.us/my.php?image=2tn3.jpg I assume I must be calculating the collision point for ellipse incorrectly, but I don't know how that could be, it seems simple 1. take the normal of the line segment 2. normalize said normal 3. multiple the normal by the ellipse radii 4. that point is how far I must move the ellipse to resolve the collision Thanks for any and all input -Matt

Share this post


Link to post
Share on other sites
I don't know exactly what the cause of the problem is, but I'll just mention that the algorithm described in the article you linked to is known to have some issues. There's a follow-up paper by Kasper Fauerby called "Improved Collision Detection and Response Using Ellipsoids" (or something like that) that you might want to look into instead.

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