Trait ncollide3d::shape::Shape [−][src]
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<&RayCast<N>> { ... } fn as_point_query(&self) -> Option<&PointQuery<N>> { ... } fn as_convex_polyhedron(&self) -> Option<&ConvexPolyhedron<N>> { ... } fn as_support_map(&self) -> Option<&SupportMap<N>> { ... } fn as_composite_shape(&self) -> Option<&CompositeShape<N>> { ... } fn is_convex_polyhedron(&self) -> bool { ... } 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
Provided Methods
fn bounding_sphere(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding sphere of self
.
fn subshape_transform(&self, _: usize) -> Option<Isometry<N>>
The transform of a specific subshape.
Return None
if the transform is known to be the identity.
fn as_ray_cast(&self) -> Option<&RayCast<N>>
The RayCast
implementation of self
.
fn as_point_query(&self) -> Option<&PointQuery<N>>
The PointQuery
implementation of self
.
fn as_convex_polyhedron(&self) -> Option<&ConvexPolyhedron<N>>
The convex polyhedron representation of self
if applicable.
fn as_support_map(&self) -> Option<&SupportMap<N>>
The support mapping of self
if applicable.
fn as_composite_shape(&self) -> Option<&CompositeShape<N>>
The composite shape representation of self
if applicable.
fn is_convex_polyhedron(&self) -> bool
Whether self
uses a conve polyhedron representation.
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.
Methods
impl<N: Real> Shape<N>
[src]
impl<N: Real> Shape<N>
Trait for casting shapes to its exact represetation.
pub fn is_shape<T: Shape<N>>(&self) -> bool
[src]
pub fn is_shape<T: Shape<N>>(&self) -> bool
Tests if this shape has a specific type T
.
pub fn as_shape<T: Shape<N>>(&self) -> Option<&T>
[src]
pub fn as_shape<T: Shape<N>>(&self) -> Option<&T>
Performs the cast.
Trait Implementations
impl<N: Real> HasBoundingVolume<N, AABB<N>> for Shape<N>
[src]
impl<N: Real> HasBoundingVolume<N, AABB<N>> for Shape<N>
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
[src]
fn bounding_volume(&self, m: &Isometry<N>) -> AABB<N>
The bounding volume of self
transformed by m
.
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Shape<N>
[src]
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Shape<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
[src]
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of self
transformed by m
.
impl<N: Real> PointQuery<N> for Shape<N>
[src]
impl<N: Real> PointQuery<N> for Shape<N>
fn project_point(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> PointProjection<N>
[src]
fn project_point(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> PointProjection<N>
Projects a point on self
transformed by m
.
fn project_point_with_feature(
&self,
m: &Isometry<N>,
pt: &Point<N>
) -> (PointProjection<N>, FeatureId)
[src]
fn project_point_with_feature(
&self,
m: &Isometry<N>,
pt: &Point<N>
) -> (PointProjection<N>, FeatureId)
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
fn distance_to_point(&self, m: &Isometry<N>, pt: &Point<N>, solid: bool) -> N
[src]
fn distance_to_point(&self, m: &Isometry<N>, pt: &Point<N>, solid: bool) -> N
Computes the minimal distance between a point and self
transformed by m
.
fn contains_point(&self, m: &Isometry<N>, pt: &Point<N>) -> bool
[src]
fn contains_point(&self, m: &Isometry<N>, pt: &Point<N>) -> bool
Tests if the given point is inside of self
transformed by m
.
impl<N: Real> RayCast<N> for Shape<N>
[src]
impl<N: Real> RayCast<N> for Shape<N>
fn toi_with_ray(&self, m: &Isometry<N>, ray: &Ray<N>, solid: bool) -> Option<N>
[src]
fn toi_with_ray(&self, m: &Isometry<N>, ray: &Ray<N>, solid: bool) -> Option<N>
Computes the time of impact between this transform shape and a ray.
fn toi_and_normal_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
[src]
fn toi_and_normal_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
Computes the time of impact, and normal between this transformed shape and a ray.
fn toi_and_normal_and_uv_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
[src]
fn toi_and_normal_and_uv_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
Computes time of impact, normal, and texture coordinates (uv) between this transformed shape and a ray. Read more
fn intersects_ray(&self, m: &Isometry<N>, ray: &Ray<N>) -> bool
[src]
fn intersects_ray(&self, m: &Isometry<N>, ray: &Ray<N>) -> bool
Tests whether a ray intersects this transformed shape.
impl<N: Real> AsRef<Shape<N>> for ShapeHandle<N>
[src]
impl<N: Real> AsRef<Shape<N>> for ShapeHandle<N>
Implementors
impl<N: Real> Shape<N> for Triangle<N>
impl<N: Real> Shape<N> for Segment<N>
impl<N: Real> Shape<N> for Ball<N>
impl<N: Real> Shape<N> for Cuboid<N>
impl<N: Real> Shape<N> for ConvexHull<N>
impl<N: Real> Shape<N> for Compound<N>
impl<N: Real> Shape<N> for TriMesh<N>
impl<N: Real> Shape<N> for Polyline<N>
impl<N: Real> Shape<N> for Plane<N>