[][src]Struct parry2d::shape::Capsule

pub struct Capsule {
    pub segment: Segment,
    pub radius: Real,
}

A capsule shape defined as a round segment.

Fields

segment: Segment

The axis and endpoint of the capsule.

radius: Real

The radius of the capsule.

Implementations

impl Capsule[src]

pub fn aabb(&self, pos: &Isometry<Real>) -> AABB[src]

The axis-aligned bounding box of this capsule.

pub fn local_aabb(&self) -> AABB[src]

The axis-aligned bounding box of this capsule.

impl Capsule[src]

pub fn bounding_sphere(&self, pos: &Isometry<Real>) -> BoundingSphere[src]

Computes the world-space bounding sphere of this capsule, transformed by pos.

pub fn local_bounding_sphere(&self) -> BoundingSphere[src]

Computes the world-space bounding sphere of this capsule.

impl Capsule[src]

pub fn new_x(half_height: Real, radius: Real) -> Self[src]

Creates a new capsule aligned with the x axis and with the given half-height an radius.

pub fn new_y(half_height: Real, radius: Real) -> Self[src]

Creates a new capsule aligned with the y axis and with the given half-height an radius.

pub fn new(a: Point<Real>, b: Point<Real>, radius: Real) -> Self[src]

Creates a new capsule defined as the segment between a and b and with the given radius.

pub fn height(&self) -> Real[src]

The height of this capsule.

pub fn half_height(&self) -> Real[src]

The half-height of this capsule.

pub fn center(&self) -> Point<Real>[src]

The center of this capsule.

pub fn transform_by(&self, pos: &Isometry<Real>) -> Self[src]

Creates a new capsule equal to self with all its endpoints transformed by pos.

pub fn canonical_transform(&self) -> Isometry<Real>[src]

The transformation such that t * Y is collinear with b - a and t * origin equals the capsule's center.

pub fn rotation_wrt_y(&self) -> Rotation<Real>[src]

The rotation r such that r * Y is collinear with b - a.

pub fn transform_wrt_y(&self) -> Isometry<Real>[src]

The transform t such that t * Y is collinear with b - a and such that t * origin = (b + a) / 2.0.

impl Capsule[src]

pub fn to_polyline(&self, nsubdiv: u32) -> Vec<Point2<Real>>[src]

Discretize the boundary of this capsule as a polygonal line.

Trait Implementations

impl Clone for Capsule[src]

impl Copy for Capsule[src]

impl Debug for Capsule[src]

impl PointQuery for Capsule[src]

impl RayCast for Capsule[src]

impl Shape for Capsule[src]

impl SupportMap for Capsule[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,