[][src]Trait ncollide_geometry::shape::Shape

pub trait Shape<P: Point, M>: Send + Sync + Any + GetTypeId {
    fn aabb(&self, m: &M) -> AABB<P>;

    fn bounding_sphere(&self, m: &M) -> BoundingSphere<P> { ... }
fn as_ray_cast(&self) -> Option<&dyn RayCast<P, M>> { ... }
fn as_point_query(&self) -> Option<&dyn PointQuery<P, M>> { ... }
fn as_support_map(&self) -> Option<&dyn SupportMap<P, M>> { ... }
fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>> { ... }
fn is_support_map(&self) -> bool { ... }
fn is_composite_shape(&self) -> bool { ... } }

Trait implemented by all shapes supported by ncollide.

This allows dynamic inspection of the shape capabilities.

Required methods

fn aabb(&self, m: &M) -> AABB<P>

The AABB of self.

Loading content...

Provided methods

fn bounding_sphere(&self, m: &M) -> BoundingSphere<P>

The bounding sphere of self.

fn as_ray_cast(&self) -> Option<&dyn RayCast<P, M>>

The RayCast implementation of self.

fn as_point_query(&self) -> Option<&dyn PointQuery<P, M>>

The PointQuery implementation of self.

fn as_support_map(&self) -> Option<&dyn SupportMap<P, M>>

The support mapping of self if applicable.

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>>

The composite shape representation of self if applicable.

fn is_support_map(&self) -> bool

Whether self uses a supportmapping-based representation.

fn is_composite_shape(&self) -> bool

Whether self uses a composite shape-based representation.

Loading content...

Methods

impl<P: Point, M: 'static> dyn Shape<P, M>[src]

Trait for casting shapes to its exact represetation.

pub fn is_shape<T: Shape<P, M>>(&self) -> bool[src]

Tests if this shape has a specific type T.

pub fn as_shape<T: Shape<P, M>>(&self) -> Option<&T>[src]

Performs the cast.

Trait Implementations

impl<P: Point, M: Isometry<P>> HasBoundingVolume<M, AABB<P>> for dyn Shape<P, M>[src]

impl<P: Point, M: Isometry<P>> HasBoundingVolume<M, BoundingSphere<P>> for dyn Shape<P, M>[src]

impl<P: Point, M: Isometry<P>> RayCast<P, M> for dyn Shape<P, M>[src]

impl<P, M> PointQuery<P, M> for dyn Shape<P, M> where
    P: Point,
    M: Isometry<P>, 
[src]

impl<P: Point, M> AsRef<dyn Shape<P, M> + 'static> for ShapeHandle<P, M>[src]

Implementors

impl<P: Point, M: 'static + Send + Sync + Isometry<P>> Shape<P, M> for Compound<P, M>[src]

fn as_support_map(&self) -> Option<&dyn SupportMap<P, M>>[src]

fn is_support_map(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for Triangle<P>[src]

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>>[src]

fn is_composite_shape(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for Segment<P>[src]

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>>[src]

fn is_composite_shape(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for ConvexHull<P>[src]

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>>[src]

fn is_composite_shape(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for TriMesh<P>[src]

fn as_support_map(&self) -> Option<&dyn SupportMap<P, M>>[src]

fn is_support_map(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for Polyline<P>[src]

fn as_support_map(&self) -> Option<&dyn SupportMap<P, M>>[src]

fn is_support_map(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for Ball<P::Real>[src]

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>>[src]

fn is_composite_shape(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for Cone<P::Real>[src]

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>>[src]

fn is_composite_shape(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for Cuboid<P::Vector>[src]

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>>[src]

fn is_composite_shape(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for Cylinder<P::Real>[src]

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>>[src]

fn is_composite_shape(&self) -> bool[src]

impl<P: Point, M: Isometry<P>> Shape<P, M> for Plane<P::Vector>[src]

fn as_support_map(&self) -> Option<&dyn SupportMap<P, M>>[src]

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<P, M>>[src]

fn is_support_map(&self) -> bool[src]

fn is_composite_shape(&self) -> bool[src]

Loading content...