Struct rapier2d::geometry::Capsule[][src]

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

A capsule shape defined as a round segment.

Fields

segment: Segment

The axis and endpoint of the capsule.

radius: f32

The radius of the capsule.

Implementations

impl Capsule[src]

pub fn aabb(&self, pos: &Isometry<f32, U2, Unit<Complex<f32>>>) -> 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<f32, U2, Unit<Complex<f32>>>
) -> 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: f32, radius: f32) -> Capsule[src]

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

pub fn new_y(half_height: f32, radius: f32) -> Capsule[src]

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

pub fn new(a: Point<f32, U2>, b: Point<f32, U2>, radius: f32) -> Capsule[src]

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

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

The height of this capsule.

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

The half-height of this capsule.

pub fn center(&self) -> Point<f32, U2>[src]

The center of this capsule.

pub fn transform_by(
    &self,
    pos: &Isometry<f32, U2, Unit<Complex<f32>>>
) -> Capsule
[src]

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

pub fn canonical_transform(&self) -> Isometry<f32, U2, Unit<Complex<f32>>>[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) -> Unit<Complex<f32>>[src]

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

pub fn transform_wrt_y(&self) -> Isometry<f32, U2, Unit<Complex<f32>>>[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<Point<f32, U2>, Global>[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

impl RefUnwindSafe for Capsule

impl Send for Capsule

impl Sync for Capsule

impl Unpin for Capsule

impl UnwindSafe for Capsule

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: Any + Send + Sync
[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.