Struct ncollide2d::shape::Capsule
source · pub struct Capsule<N> { /* private fields */ }
Expand description
SupportMap description of a capsule shape with its principal axis aligned with the y
axis.
Implementations§
source§impl<N: Real> Capsule<N>
impl<N: Real> Capsule<N>
sourcepub fn new(half_height: N, radius: N) -> Capsule<N>
pub fn new(half_height: N, radius: N) -> Capsule<N>
Creates a new capsule.
Arguments:
half_height
- the half length of the capsule along they
axis.radius
- radius of the rounded part of the capsule.
sourcepub fn half_height(&self) -> N
pub fn half_height(&self) -> N
The capsule half length along the y
axis.
Trait Implementations§
source§impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Capsule<N>
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Capsule<N>
source§fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
fn bounding_volume(&self, m: &Isometry<N>) -> BoundingSphere<N>
The bounding volume of
self
transformed by m
.source§impl<N: PartialEq> PartialEq<Capsule<N>> for Capsule<N>
impl<N: PartialEq> PartialEq<Capsule<N>> for Capsule<N>
source§impl<N: Real> PointQuery<N> for Capsule<N>
impl<N: Real> PointQuery<N> for Capsule<N>
source§fn project_point(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> PointProjection<N>
fn project_point(
&self,
m: &Isometry<N>,
pt: &Point<N>,
solid: bool
) -> PointProjection<N>
Projects a point on
self
transformed by m
.source§fn project_point_with_feature(
&self,
m: &Isometry<N>,
pt: &Point<N>
) -> (PointProjection<N>, FeatureId)
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 moresource§impl<N: Real> RayCast<N> for Capsule<N>
impl<N: Real> RayCast<N> for Capsule<N>
source§fn toi_and_normal_with_ray(
&self,
m: &Isometry<N>,
ray: &Ray<N>,
solid: bool
) -> Option<RayIntersection<N>>
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.
source§impl<N: Real> SupportMap<N> for Capsule<N>
impl<N: Real> SupportMap<N> for Capsule<N>
source§impl<N: Real> ToPolyline<N> for Capsule<N>
impl<N: Real> ToPolyline<N> for Capsule<N>
type DiscretizationParameter = u32
impl<N> StructuralPartialEq for Capsule<N>
Auto Trait Implementations§
impl<N> RefUnwindSafe for Capsule<N>where
N: RefUnwindSafe,
impl<N> Send for Capsule<N>where
N: Send,
impl<N> Sync for Capsule<N>where
N: Sync,
impl<N> Unpin for Capsule<N>where
N: Unpin,
impl<N> UnwindSafe for Capsule<N>where
N: UnwindSafe,
Blanket Implementations§
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.