Search Unity

Ellipsoid Collisions

Discussion in 'General Discussion' started by yoonitee, Jul 30, 2014.

  1. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    I was just reading this report* about collision detection for ellipses (2D) and ellipsoids (3D).

    I'll recap so you don't have to read it.

    If X=(x,y,1) and A is a matrix
    [a, b, d]
    [b, c, e]
    [d, e, f]

    so that X.A.X<0 is the equation of an ellipse ( ax^2+2bxy+cy^2+2dx+2ey+f < 0)
    and X.B.X<0 is the equation of another ellipse.

    The condition they don't overlap is that P(w) = det(Aw+B) = 0, has two real negative solutions for w. Now it's not necessary to actually find the roots just to show that they exist. Which can be done by examining the discriminants and other functions of the coefficients of the polynomial P(w). Note in most cases these polynomials tend to be very large maybe 12th order!

    It's all a bit fiddly, but essentially it looks like exact ellipsoid-ellipsoid collisions are perfectly possible. Perhaps they would be good for modelling eggs? Of course, an egg mesh would probably be more efficient but I like the idea of the exactness.

    I doubt they will be implemented by any physics engine very soon (Unity?). But it might be "fun" to try and write your own physics collision detection for ellipses/ellipsoids. I'm trying to come up with a good game idea for it!

    *the actual algorithm starts on page 61
     
    Last edited: Jul 30, 2014