1
\$\begingroup\$

I am using a physics library based on the Bullet physics engine. How do I create an egg shaped object or a cylinder where the width differs from the depth (i.e. with an oval shape)?

I'm not looking for code, but for a conceptual answer to help me understand this, or a useful approximation.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Approximate the shape with a convex hull geometry. \$\endgroup\$
    – msell
    Jul 31 '14 at 7:21
  • 1
    \$\begingroup\$ As circle is special form of ellipse with equal deformations in both axis, sphere is only special of ellipsoid (egg). Apply corresponding deformations and voilá, you v got egg. \$\endgroup\$
    – wondra
    Jul 31 '14 at 10:02
1
\$\begingroup\$

If having your overall collision surface look something like this is acceptable, then yes, use a couplefew sphere colliders parented together somehow, since spheres are cheap (in fact I think the reason they're cheap in physics is because they're restricted to distance checks from a point, which is why you can't transform them):

Kong rubber dog toy made out of joined spheres

Otherwise I would suggest making a convex hull out of e.g. a cylinder with a bulge in the middle if you need it fast. Here's one I hacked up in blender in a few mintues using an 8-sided cylinder and some loop cuts and scaling.

A high poly uvsphere made obloid with a lowpoly collision mesh I hacked up in blender quickly

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .