pub trait Shape<const D: usize>: Send + Sync {
// Required methods
fn support(&self, direction: &SVector<f64, D>) -> SVector<f64, D>;
fn bounding_sphere(&self) -> (Point<D>, f64);
fn as_any(&self) -> &dyn Any;
}Expand description
Trait for D-dimensional convex shapes compatible with GJK collision detection.
The support function is the only requirement for GJK — given a direction, return the point on the shape’s boundary furthest in that direction. This generalizes naturally to any dimension.
Required Methods§
Sourcefn support(&self, direction: &SVector<f64, D>) -> SVector<f64, D>
fn support(&self, direction: &SVector<f64, D>) -> SVector<f64, D>
Support function: furthest point on the boundary in the given direction.
Sourcefn bounding_sphere(&self) -> (Point<D>, f64)
fn bounding_sphere(&self) -> (Point<D>, f64)
Bounding sphere: (center, radius).