Obviously, the collada physics design should make sense. For example, an ellipsoid should be specified by 3 floats (radii) instead of 2. These three floats would correspond to the radius along the x y and z axes in that order. With that in mind, refer to the capsule element in Collada. The capsule is a swept ellipsoid. However this element is currently specified by only 2 radiuses at the endpoints. Clearly this should be 3.
Furthermore, instead of creating a separate cylinder element, why not use a capsule but just set the y radius to 0 (assuming we are using 3 radiuses and the capsule is oriented along y). i.e. since we can easily create a cylinder using the capsule element, there is no need to also have the cylinder in the schema - its redundant. As before, Physics engines that only support spherical/circular capsules can continue to use the first radius and just ignore the other two radiuses and/or spit out a warning.
Now consider that the Collada has added support for tapered capsules where one end of the capsule is wider than the other. Apparently there was sufficient usage/interest to have this added to the spec. There have been some concerns about how these shapes are defined. (ambiguity and possibility of concavity) Furthermore, it does seem like a very special case. If you add tapered capsules, what's next? buckyballs with rounded edges? Where do you stop? Instead of creating one-off elements, it would be better if there was an simple and general way to specify things like tapered capsules, rounded buckyballs, and other rounded primitives using a minimum amount of information.
Fortunately, (thanks to a brilliant suggestion by Erwin) there is such an elegant solution to creating tapered capsules and other collision shapes. Consider that the tapered capsules is simply the convex hull of two ellipsoid shapes. Specifying it in this manner removes the ambiguity as to how is the volume between the two ellipsoids defined. Now not every collision system will support tapered capsules, but any gjk based system that supports ellipsoids easily could. When finding the support point for a given direction it checks both ellipsoids and picks the best answer at each iteration. Keeping that in mind, its easy to see that this doesn't have to be limited to just two ellipsoids, nor to even just ellipsoids. One can create a cone using a point and a disc (ellipsoid with 1 radius set to 0) or a rounded cone using a point and an ellipsoid.
The way the data for a tapered capsule might look in a collada file could be something roughly like:
Code: Select all
<rigidbody>
<hullshape>
<ellipsoid> </ellipsoid>
<ellipsoid> </ellipsoid>
</hullshape>
</rigidbody>
The idea being that the rigidbody's shape is the hull of the 2 nested primitives which in this case are ellipsoids.
Please ignore any specific details about the way the xml is expressed in the above example. I realize its not exacly the way collada expresses things. I oversimplified it on purpose. What I dont want to see happen is the discussion turns to fileformat xml syntax issues. When the dicussions go down that road the physics gurus eyes glaze over and they walk away. This is unfortunate since these are the people most needed at the table. Otherwise you could end up with a specification saying something silly such as angular velocity is measured in degrees.
comments welcome