-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ellipse collision tests only work with circles #584
Comments
one small note : as a prior simple AABB collision check is done using the ellipse bounding box, "only" the collision response won't be fully accurate. |
I really loved the idea in this post answer : Instead of solving the collision between the ellipse and a polygon, it might be easier to calculate the inverse transformation matrix, that transforms the ellipse to a circle, and transform the polygon too using that matrix, then we can make a simple (already working) circle to polygon collision tests :) Few comments :
|
same here -> 3.1.0 |
@obiot Did you really mean to close this ticket? |
yes, i tried to clean up some tickets, and I created one with all the ellipse limitations, see #809, that refers to this one |
The collision tests for ellipse assume that the ellipse is a perfect circle, e.g. that its radius is uniform in every direction. Ellipses are allowed stretch over the X and Y axes, turning it into an oval.
me.Ellipse
has some properties for handling this:radius
is the maximum radiusscaleV
is a unit vector representing the ratio between the maximum radius and the x,y axes.radiusV
is a pre-scaled vector representing the actual radius along the x and y axes.The SAT collision tests currently only use
radius
, which is fine for circles. To support scaled ellipses, theradius
must be scaled byscaleV
and thecos
andsin
for the angle between the ellipses. The angle is determined usingatan2
.The text was updated successfully, but these errors were encountered: