Struct ncollide2d::shape::Capsule [−][src]
pub struct Capsule<N> { /* fields omitted */ }
SupportMap description of a capsule shape with its principal axis aligned with the y
axis.
Methods
impl<N: Real> Capsule<N>
[src]
impl<N: Real> Capsule<N>
pub fn new(half_height: N, radius: N) -> Capsule<N>
[src]
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.
pub fn half_height(&self) -> N
[src]
pub fn half_height(&self) -> N
The capsule half length along the y
axis.
pub fn radius(&self) -> N
[src]
pub fn radius(&self) -> N
The radius of the capsule's rounded part.
Trait Implementations
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Capsule<N>
[src]
impl<N: Real> HasBoundingVolume<N, BoundingSphere<N>> for Capsule<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 Capsule<N>
[src]
impl<N: Real> PointQuery<N> for Capsule<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 Capsule<N>
[src]
impl<N: Real> RayCast<N> for Capsule<N>
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_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 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: PartialEq> PartialEq for Capsule<N>
[src]
impl<N: PartialEq> PartialEq for Capsule<N>
fn eq(&self, other: &Capsule<N>) -> bool
[src]
fn eq(&self, other: &Capsule<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Capsule<N>) -> bool
[src]
fn ne(&self, other: &Capsule<N>) -> bool
This method tests for !=
.
impl<N: Debug> Debug for Capsule<N>
[src]
impl<N: Debug> Debug for Capsule<N>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<N: Clone> Clone for Capsule<N>
[src]
impl<N: Clone> Clone for Capsule<N>
fn clone(&self) -> Capsule<N>
[src]
fn clone(&self) -> Capsule<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<N: Real> SupportMap<N> for Capsule<N>
[src]
impl<N: Real> SupportMap<N> for Capsule<N>
fn support_point(&self, m: &Isometry<N>, dir: &Vector<N>) -> Point<N>
[src]
fn support_point(&self, m: &Isometry<N>, dir: &Vector<N>) -> Point<N>
Evaluates the support function of the object. Read more
fn support_point_toward(
&self,
m: &Isometry<N>,
dir: &Unit<Vector<N>>
) -> Point<N>
[src]
fn support_point_toward(
&self,
m: &Isometry<N>,
dir: &Unit<Vector<N>>
) -> Point<N>
Same as self.support_point
except that dir
is normalized.
impl<N: Real> ToPolyline<N> for Capsule<N>
[src]
impl<N: Real> ToPolyline<N> for Capsule<N>
type DiscretizationParameter = u32
fn to_polyline(&self, nsubdiv: u32) -> Polyline<N>
[src]
fn to_polyline(&self, nsubdiv: u32) -> Polyline<N>
Builds a triangle mesh from this shape. Read more