Trait ncollide2d::shape::Shape

source ·
pub trait Shape<N: Real>: Send + Sync + Any + GetTypeId {
    fn aabb(&self, m: &Isometry<N>) -> AABB<N>;

    fn bounding_sphere(&self, m: &Isometry<N>) -> BoundingSphere<N> { ... }
    fn subshape_transform(&self, _: usize) -> Option<Isometry<N>> { ... }
    fn as_ray_cast(&self) -> Option<&dyn RayCast<N>> { ... }
    fn as_point_query(&self) -> Option<&dyn PointQuery<N>> { ... }
    fn as_convex_polyhedron(&self) -> Option<&dyn ConvexPolyhedron<N>> { ... }
    fn as_support_map(&self) -> Option<&dyn SupportMap<N>> { ... }
    fn as_composite_shape(&self) -> Option<&dyn CompositeShape<N>> { ... }
    fn is_convex_polyhedron(&self) -> bool { ... }
    fn is_support_map(&self) -> bool { ... }
    fn is_composite_shape(&self) -> bool { ... }
}
Expand description

Trait implemented by all shapes supported by ncollide.

This allows dynamic inspection of the shape capabilities.

Required Methods§

The AABB of self.

Provided Methods§

The bounding sphere of self.

The transform of a specific subshape.

Return None if the transform is known to be the identity.

The RayCast implementation of self.

The PointQuery implementation of self.

The convex polyhedron representation of self if applicable.

The support mapping of self if applicable.

The composite shape representation of self if applicable.

Whether self uses a conve polyhedron representation.

Whether self uses a supportmapping-based representation.

Whether self uses a composite shape-based representation.

Implementations§

Trait for casting shapes to its exact represetation.

Tests if this shape has a specific type T.

Performs the cast.

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
The bounding volume of self transformed by m.
The bounding volume of self transformed by m.
Projects a point on self transformed by m.
Projects a point on the boundary of self transformed by m and retuns the id of the feature the point was projected on. Read more
Computes the minimal distance between a point and self transformed by m.
Tests if the given point is inside of self transformed by m.
Computes the time of impact between this transform shape and a ray.
Computes the time of impact, and normal between this transformed shape and a ray.
Tests whether a ray intersects this transformed shape.

Implementors§