Hi, I was wondering if Unreal has any plans to implement ellipsoid-ellipsoid collision detection? I’m guessing the general policy is to only implement things that are in PhysX which only includes spheres not ellipsoids.
There are lots of articles on the internet showing that ellipsoid collision detection is not that difficult.
Ellipsoids would be very useful to model collisions with people.
What do you think? Maybe put it on the timetable as a “maybe”.
There are currently no plans for this. I’ve looped in some other people internally to see if anyone sees a need for this. The concern is that we’d be adding an extra code path which does not go through the physics engine which adds complexity and possible bugs. In the people case you can use a capsule which should suffice for most cases. Do you have any other use cases in mind?
I think generally any kind of organic shapes would work well, such as limbs, e.g. an ellipsoid for an arm, one for the head, etc. I think the main use of it would be if you had say hundreds of rag-dolls then you would save a lot of time since you could model them using fewer ellipsoids than other shapes.
Or for modelling hit areas, it would be a nice shape to use. Maybe just for static volumes.
I guess, if you wanted to add a really simple collision volume to a flying saucer…
It’s just an idea! Something to think about.
I think you may be right that it’s one of those things that would be really nice (and you could probably make some really efficient games and reduce frame-rates and have more characters on-screen) but the potential bugs it could introduce might out-weigh the benefits. And if it didn’t go through the physics engine then you might not get the benefit. IDK Maybe there’s a reason why PhysX doesn’t support it. Too much trouble!
Maybe one of the devs who likes maths might implement it as a add-on just for fun!
I forgot to add: If you put a sphere collider on a sphere, then stretch or rotate that sphere, the collider no longer is the same shape as the object (if you don’t have ellipsoids). Whereas for a box collider it just becomes a cuboid.
So basically the need for it would be to be able to stretch game objects which have cube and sphere colliders on them. Currently that would only work for cuboid, and mesh colliders.
It might work like this:
You’d have to work out the perpendicular to the plane of intersection of the two ellipses and the mid point of the intersection. And also how far in the ellipses overlapped. Unlike the sphere case there would be a torque on the ellipsoids as they hit each other.
The equations of a general rotated ellipsoid can be expressed as Ax^2+By^2+Cz^2+Dxy+Exz+Fyz+Gx+Hy+Iz+1=0. (So 9 numbers compared to a spheres 4).
I don’t have a 3D muscular arm handy (heh), so I grabbed a random image off Google Images instead.
That’s a pretty muscular arm!
Then I went ahead and approximately mapped it with capsules in Paint.NET.
Looks pretty good, but the forearm could use some work. The actual arm mapped quite well.
So I then went and did the same with ellipsoids. This took me longer to get results that I’m happy with, but I don’t think it looks better. I think it looks significantly worse.
Now the forearm still isn’t quite right but I feel it did map a little better than the capsule. But the arm itself is way worse now.
As far as speeding up calculations, capsules should be way faster than ellipsoids, not just because they’re officially supported in PhysX, but because they’re essentially two spheres on either end of a cylinder. Both of those shapes are dead simple to test collisions against, relatively speaking of course.
EDIT: Looking back I should have pulled the forearm’s collider back to the actual elbow. Still, it was meant to be a quick mock-up, being a perfectionist about things like that isn’t helpful.