Announcement

Collapse
No announcement yet.

Ellipsoid Collisions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Ellipsoid Collisions

    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".
    Last edited by zooby; 08-17-2014, 06:56 PM.

    #2
    Hi zooby,

    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?

    Comment


      #3
      Originally posted by Ori Cohen View Post
      Hi zooby,

      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:
      Click image for larger version

Name:	ellipsoids.png
Views:	1
Size:	8.5 KB
ID:	1053645
      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).
      Last edited by zooby; 08-18-2014, 08:25 PM.

      Comment


        #4
        Originally posted by zooby View Post
        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.
        How is an ellipsoid more suited to an arm than a capsule?

        Comment


          #5
          Well your arm make look like a capsule. Buy my arm looks like an ellipsoid:

          Click image for larger version

Name:	arnie.jpg
Views:	1
Size:	61.2 KB
ID:	1053649

          Comment


            #6
            I don't have a 3D muscular arm handy (heh), so I grabbed a random image off Google Images instead. Click image for larger version

Name:	Arm.jpg
Views:	1
Size:	23.0 KB
ID:	1053654

            That's a pretty muscular arm!

            Then I went ahead and approximately mapped it with capsules in Paint.NET. Click image for larger version

Name:	arm collision capsule.png
Views:	1
Size:	97.0 KB
ID:	1053655

            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. Click image for larger version

Name:	arm collision ellipsoid.png
Views:	1
Size:	97.0 KB
ID:	1053656

            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. :P
            Last edited by Veovis Muad'dib; 08-18-2014, 10:23 PM.

            Comment


              #7
              Yes, but what about flying saucers? Or modelling a jar of M&Ms?
              Click image for larger version

Name:	mm2.jpg
Views:	1
Size:	140.1 KB
ID:	1053678

              Or an basket of eggs?
              Click image for larger version

Name:	eggs-basket.jpg
Views:	1
Size:	4.3 KB
ID:	1053682

              Or a rugby ball?

              Click image for larger version

Name:	rugby-ball-1.jpg
Views:	1
Size:	14.6 KB
ID:	1053679

              An American football wouldn't quite work since it is a bit pointy but would be better than sphere.

              Or the Grand Theatre in Paris:

              Click image for larger version

Name:	grandntltheater.jpg
Views:	1
Size:	31.1 KB
ID:	1053680

              Or a simulation featuring thousands of red blood cells.

              Or a cave full of Opals:
              Click image for larger version

Name:	Australian_White_Opals2.jpg
Views:	1
Size:	96.3 KB
ID:	1053681
              Last edited by zooby; 08-19-2014, 12:02 PM.

              Comment

              Working...
              X