[][src]Struct rapier3d::geometry::Capsule

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

A capsule shape defined as a round segment.

Fields

segment: Segment<f32>

The axis and endpoint of the capsule.

radius: f32

The radius of the capsule.

Implementations

impl Capsule[src]

pub fn new_x(half_height: f32, radius: f32) -> 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: f32, radius: f32) -> Self[src]

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

pub fn new_z(half_height: f32, radius: f32) -> Self[src]

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

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

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

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

The axis-aligned bounding box of this capsule.

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>[src]

The center of this capsule.

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

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

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

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

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

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

Trait Implementations

impl Clone for Capsule[src]

impl Copy for Capsule[src]

impl Debug for Capsule[src]

impl PointQuery<f32> for Capsule[src]

impl RayCast<f32> for Capsule[src]

impl Shape for Capsule[src]

impl SupportMap<f32> 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: Send + Sync + Any
[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<T> Slottable for T where
    T: Copy
[src]

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>,