Struct heron::rapier_plugin::rapier3d::parry::mass_properties::MassProperties [−][src]
pub struct MassProperties {
pub local_com: OPoint<f32, Const<3_usize>>,
pub inv_mass: f32,
pub inv_principal_inertia_sqrt: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>,
pub principal_inertia_local_frame: Unit<Quaternion<f32>>,
}
Expand description
The local mass properties of a rigid-body.
Fields
local_com: OPoint<f32, Const<3_usize>>
The center of mass of a rigid-body expressed in its local-space.
inv_mass: f32
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: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
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.
principal_inertia_local_frame: Unit<Quaternion<f32>>
The principal vectors of the local angular inertia tensor of the rigid-body.
Implementations
Initializes the mass properties from the given center-of-mass, mass, and principal angular inertia.
The center-of-mass is specified in the local-space of the rigid-body. The principal angular inertia are the angular inertia along the coordinate axes in the local-space of the rigid-body.
pub fn with_principal_inertia_frame(
local_com: OPoint<f32, Const<3_usize>>,
mass: f32,
principal_inertia: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>,
principal_inertia_local_frame: Unit<Quaternion<f32>>
) -> MassProperties
pub fn with_principal_inertia_frame(
local_com: OPoint<f32, Const<3_usize>>,
mass: f32,
principal_inertia: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>,
principal_inertia_local_frame: Unit<Quaternion<f32>>
) -> MassProperties
Initializes the mass properties from the given center-of-mass, mass, and principal angular inertia.
The center-of-mass is specified in the local-space of the rigid-body.
The principal angular inertia are the angular inertia along the coordinate axes defined by
the principal_inertia_local_frame
expressed in the local-space of the rigid-body.
pub fn with_inertia_matrix(
local_com: OPoint<f32, Const<3_usize>>,
mass: f32,
inertia: Matrix<f32, Const<{_: usize}>, Const<{_: usize}>, ArrayStorage<f32, 3_usize, 3_usize>>
) -> MassProperties
pub fn with_inertia_matrix(
local_com: OPoint<f32, Const<3_usize>>,
mass: f32,
inertia: Matrix<f32, Const<{_: usize}>, Const<{_: usize}>, ArrayStorage<f32, 3_usize, 3_usize>>
) -> MassProperties
Initialize a new MassProperties
from a given center-of-mass, mass, and angular inertia matrix.
The angular inertia matrix will be diagonalized in order to extract the principal inertia values and principal inertia frame.
The world-space center of mass of the rigid-body.
The world-space inverse angular inertia tensor of the rigid-body.
pub fn reconstruct_inverse_inertia_matrix(
&self
) -> Matrix<f32, Const<{_: usize}>, Const<{_: usize}>, ArrayStorage<f32, 3_usize, 3_usize>>
pub fn reconstruct_inverse_inertia_matrix(
&self
) -> Matrix<f32, Const<{_: usize}>, Const<{_: usize}>, ArrayStorage<f32, 3_usize, 3_usize>>
Reconstructs the inverse angular inertia tensor of the rigid body from its principal inertia values and axes.
pub fn reconstruct_inertia_matrix(
&self
) -> Matrix<f32, Const<{_: usize}>, Const<{_: usize}>, ArrayStorage<f32, 3_usize, 3_usize>>
pub fn reconstruct_inertia_matrix(
&self
) -> Matrix<f32, Const<{_: usize}>, Const<{_: usize}>, ArrayStorage<f32, 3_usize, 3_usize>>
Reconstructs the angular inertia tensor of the rigid body from its principal inertia values and axes.
pub fn transform_by(
&self,
m: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>
) -> MassProperties
pub fn transform_by(
&self,
m: &Isometry<f32, Unit<Quaternion<f32>>, 3_usize>
) -> MassProperties
Transform each element of the mass properties.
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.
Computes the mass properties of a ball.
pub fn from_compound(
density: f32,
shapes: &[(Isometry<f32, Unit<Quaternion<f32>>, 3_usize>, SharedShape)]
) -> MassProperties
pub fn from_compound(
density: f32,
shapes: &[(Isometry<f32, Unit<Quaternion<f32>>, 3_usize>, SharedShape)]
) -> MassProperties
Computes the mass properties of a compound shape.
pub fn from_cuboid(
density: f32,
half_extents: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
) -> MassProperties
pub fn from_cuboid(
density: f32,
half_extents: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
) -> MassProperties
Computes the mass properties of a cuboid.
Computes the mass properties of a cylinder.
Trait Implementations
The default tolerance to use when testing values that are close together. Read more
pub fn abs_diff_eq(
&self,
other: &MassProperties,
epsilon: <MassProperties as AbsDiffEq<MassProperties>>::Epsilon
) -> bool
pub fn abs_diff_eq(
&self,
other: &MassProperties,
epsilon: <MassProperties as AbsDiffEq<MassProperties>>::Epsilon
) -> bool
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of [AbsDiffEq::abs_diff_eq
].
type Output = MassProperties
type Output = MassProperties
The resulting type after applying the +
operator.
Performs the +
operation. Read more
Performs the +=
operation. Read more
impl From<MassProperties> for RigidBodyMassProps
impl From<MassProperties> for RigidBodyMassProps
pub fn from(local_mprops: MassProperties) -> RigidBodyMassProps
pub fn from(local_mprops: MassProperties) -> RigidBodyMassProps
Performs the conversion.
impl From<MassProperties> for ColliderMassProps
impl From<MassProperties> for ColliderMassProps
pub fn from(mprops: MassProperties) -> ColliderMassProps
pub fn from(mprops: MassProperties) -> ColliderMassProps
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
The default relative tolerance for testing values that are far-apart. Read more
pub fn relative_eq(
&self,
other: &MassProperties,
epsilon: <MassProperties as AbsDiffEq<MassProperties>>::Epsilon,
max_relative: <MassProperties as AbsDiffEq<MassProperties>>::Epsilon
) -> bool
pub fn relative_eq(
&self,
other: &MassProperties,
epsilon: <MassProperties as AbsDiffEq<MassProperties>>::Epsilon,
max_relative: <MassProperties as AbsDiffEq<MassProperties>>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of [RelativeEq::relative_eq
].
type Output = MassProperties
type Output = MassProperties
The resulting type after applying the -
operator.
Performs the -
operation. Read more
Performs the -=
operation. Read more
Method which takes an iterator and generates Self
from the elements by
“summing up” the items. Read more
Auto Trait Implementations
impl RefUnwindSafe for MassProperties
impl Send for MassProperties
impl Sync for MassProperties
impl Unpin for MassProperties
impl UnwindSafe for MassProperties
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more