Open kevinw opened 6 years ago
I agree this is not extensible enough and should be improved!
Though keep in mind the Volumetric
trait is not strictly required by nphysics: all you need is a way to retrieve the center of mass and inertia from your shape if you want to use them for the creation of a rigid body or multibody link.
One solution for this would be to:
Volumetric
trait to ncollide.Shape
trait the method fn as_volumetric(&self) -> Option<&Volumetric> {}
.Volumetric
and adapt the corresponding implementation of Shape
so it includes: fn as_volumetric(&self) -> Option<&Volumetric> { Some(self as &Volumetric) }
.
I was implementing an Ellipsoid Shape, but when I got to the Volumetric trait, I realized that it is hardcoded for the specific Shapes that ship with nphysics:
We need a way to implement Volumetric for crate-provided Shape structs.