[][src]Struct parry2d::mass_properties::MassProperties

pub struct MassProperties {
    pub local_com: Point<Real>,
    pub inv_mass: Real,
    pub inv_principal_inertia_sqrt: AngVector<Real>,
}

The local mass properties of a rigid-body.

Fields

local_com: Point<Real>

The center of mass of a rigid-body expressed in its local-space.

inv_mass: Real

The inverse of the mass of a rigid-body.

If this is zero, the rigid-body is assumed to have infinite mass.

inv_principal_inertia_sqrt: AngVector<Real>

The inverse of the principal angular inertia of the rigid-body.

Components set to zero are assumed to be infinite along the corresponding principal axis.

Implementations

impl MassProperties[src]

pub fn new(local_com: Point<Real>, mass: Real, principal_inertia: Real) -> Self[src]

Initializes the mass properties with the given center-of-mass, mass, and angular inertia.

The center-of-mass is specified in the local-space of the rigid-body.

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

The world-space center of mass of the rigid-body.

pub fn world_inv_inertia_sqrt(
    &self,
    _rot: &Rotation<Real>
) -> AngularInertia<Real>
[src]

The world-space inverse angular inertia tensor of the rigid-body.

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

Transform each element of the mass properties.

impl MassProperties[src]

pub fn from_ball(density: Real, radius: Real) -> Self[src]

Computes the mass properties of a ball.

impl MassProperties[src]

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

Computes the mass properties of a capsule.

impl MassProperties[src]

pub fn from_compound(
    density: Real,
    shapes: &[(Isometry<Real>, SharedShape)]
) -> Self
[src]

Computes the mass properties of a compound shape.

impl MassProperties[src]

pub fn from_convex_polygon(
    density: Real,
    vertices: &[Point<Real>]
) -> MassProperties
[src]

Computes the mass properties of a convex polygon.

impl MassProperties[src]

pub fn from_cuboid(density: Real, half_extents: Vector<Real>) -> Self[src]

Computes the mass properties of a cuboid.

impl MassProperties[src]

pub fn from_triangle(
    density: Real,
    a: &Point<Real>,
    b: &Point<Real>,
    c: &Point<Real>
) -> MassProperties
[src]

Computes the mass properties of a triangle.

impl MassProperties[src]

pub fn from_trimesh(
    density: Real,
    vertices: &[Point<Real>],
    indices: &[[u32; 3]]
) -> MassProperties
[src]

Computes the mass properties of a triangle-mesh.

Trait Implementations

impl AbsDiffEq<MassProperties> for MassProperties[src]

type Epsilon = Real

Used for specifying relative comparisons.

impl Add<MassProperties> for MassProperties[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<MassProperties> for MassProperties[src]

impl Clone for MassProperties[src]

impl Copy for MassProperties[src]

impl Debug for MassProperties[src]

impl PartialEq<MassProperties> for MassProperties[src]

impl RelativeEq<MassProperties> for MassProperties[src]

impl StructuralPartialEq for MassProperties[src]

impl Sub<MassProperties> for MassProperties[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<MassProperties> for MassProperties[src]

impl Sum<MassProperties> for MassProperties[src]

impl Zero for MassProperties[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, Right> ClosedAdd<Right> for T where
    T: Add<Right, Output = T> + AddAssign<Right>, 
[src]

impl<T, Right> ClosedSub<Right> for T where
    T: Sub<Right, Output = T> + SubAssign<Right>, 
[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<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[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>,