Struct parry2d::mass_properties::MassProperties [−][src]
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]
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]
&self,
_rot: &Rotation<Real>
) -> AngularInertia<Real>
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.
pub fn set_mass(&mut self, new_mass: Real, adjust_angular_inertia: bool)
[src]
Changes the mass on these mass-properties.
The adjust_angular_inertia
argument should always be true
, unless
there are some specific reasons not to do so. Setting this to true
will automatically adjust the angular inertia of self
to account
for the mass change (i.e. it will multiply the angular inertia by
new_mass / prev_mass
). Setting it to false
will not change the
current angular inertia.
impl MassProperties
[src]
impl MassProperties
[src]impl MassProperties
[src]
impl MassProperties
[src]impl MassProperties
[src]
impl MassProperties
[src]pub fn from_compound(
density: Real,
shapes: &[(Isometry<Real>, SharedShape)]
) -> Self
[src]
density: Real,
shapes: &[(Isometry<Real>, SharedShape)]
) -> Self
Computes the mass properties of a compound shape.
impl MassProperties
[src]
impl MassProperties
[src]pub fn from_convex_polygon(
density: Real,
vertices: &[Point<Real>]
) -> MassProperties
[src]
density: Real,
vertices: &[Point<Real>]
) -> MassProperties
Computes the mass properties of a convex polygon.
impl MassProperties
[src]
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]
impl MassProperties
[src]pub fn from_triangle(
density: Real,
a: &Point<Real>,
b: &Point<Real>,
c: &Point<Real>
) -> MassProperties
[src]
density: Real,
a: &Point<Real>,
b: &Point<Real>,
c: &Point<Real>
) -> MassProperties
Computes the mass properties of a triangle.
impl MassProperties
[src]
impl MassProperties
[src]Trait Implementations
impl AbsDiffEq<MassProperties> for MassProperties
[src]
impl AbsDiffEq<MassProperties> for MassProperties
[src]type Epsilon = Real
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
pub fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
impl Add<MassProperties> for MassProperties
[src]
impl Add<MassProperties> for MassProperties
[src]type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: MassProperties) -> Self
[src]
impl AddAssign<MassProperties> for MassProperties
[src]
impl AddAssign<MassProperties> for MassProperties
[src]fn add_assign(&mut self, rhs: MassProperties)
[src]
impl Clone for MassProperties
[src]
impl Clone for MassProperties
[src]fn clone(&self) -> MassProperties
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for MassProperties
[src]
impl Copy for MassProperties
[src]impl PartialEq<MassProperties> for MassProperties
[src]
impl PartialEq<MassProperties> for MassProperties
[src]fn eq(&self, other: &MassProperties) -> bool
[src]
fn ne(&self, other: &MassProperties) -> bool
[src]
impl RelativeEq<MassProperties> for MassProperties
[src]
impl RelativeEq<MassProperties> for MassProperties
[src]fn default_max_relative() -> Self::Epsilon
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
pub fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
impl StructuralPartialEq for MassProperties
[src]
impl StructuralPartialEq for MassProperties
[src]impl Sub<MassProperties> for MassProperties
[src]
impl Sub<MassProperties> for MassProperties
[src]type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: MassProperties) -> Self
[src]
impl SubAssign<MassProperties> for MassProperties
[src]
impl SubAssign<MassProperties> for MassProperties
[src]fn sub_assign(&mut self, rhs: MassProperties)
[src]
impl Sum<MassProperties> for MassProperties
[src]
impl Sum<MassProperties> for MassProperties
[src]Auto Trait Implementations
impl RefUnwindSafe for MassProperties
impl RefUnwindSafe for MassProperties
impl Send for MassProperties
impl Send for MassProperties
impl Sync for MassProperties
impl Sync for MassProperties
impl Unpin for MassProperties
impl Unpin for MassProperties
impl UnwindSafe for MassProperties
impl UnwindSafe for MassProperties
Blanket Implementations
impl<T> CheckedAs for T
[src]
impl<T> CheckedAs for T
[src]pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]
T: CheckedCast<Dst>,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]pub fn lossless_try_into(self) -> Option<Dst>
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]pub fn lossy_into(self) -> Dst
[src]
impl<T> OverflowingAs for T
[src]
impl<T> OverflowingAs for T
[src]pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]
T: OverflowingCast<Dst>,
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SaturatingAs for T
[src]
impl<T> SaturatingAs for T
[src]pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]
T: SaturatingCast<Dst>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> UnwrappedAs for T
[src]
impl<T> UnwrappedAs for T
[src]pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]
T: UnwrappedCast<Dst>,
impl<T> WrappingAs for T
[src]
impl<T> WrappingAs for T
[src]pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]
T: WrappingCast<Dst>,