pub struct RigidBodyMassProps {
pub world_com: Point<f32>,
pub effective_inv_mass: Vector<f32>,
pub effective_world_inv_inertia: AngularInertia<f32>,
pub local_mprops: MassProperties,
pub flags: LockedAxes,
pub additional_local_mprops: Option<Box<RigidBodyAdditionalMassProps>>,
}Expand description
The mass properties of a rigid-body.
Fields§
§world_com: Point<f32>The world-space center of mass of the rigid-body.
effective_inv_mass: Vector<f32>The inverse mass taking into account translation locking.
effective_world_inv_inertia: AngularInertia<f32>The square-root of the world-space inverse angular inertia tensor of the rigid-body, taking into account rotation locking.
local_mprops: MassPropertiesThe local mass properties of the rigid-body.
flags: LockedAxesFlags for locking rotation and translation.
additional_local_mprops: Option<Box<RigidBodyAdditionalMassProps>>Mass-properties of this rigid-bodies, added to the contributions of its attached colliders.
Implementations§
Source§impl RigidBodyMassProps
impl RigidBodyMassProps
Sourcepub fn effective_mass(&self) -> Vector<f32>
pub fn effective_mass(&self) -> Vector<f32>
The effective mass (that takes the potential translation locking into account) of this rigid-body.
Sourcepub fn effective_angular_inertia(&self) -> AngularInertia<f32>
pub fn effective_angular_inertia(&self) -> AngularInertia<f32>
The square root of the effective world-space angular inertia (that takes the potential rotation locking into account) of this rigid-body.
Sourcepub fn recompute_mass_properties_from_colliders(
&mut self,
colliders: &ColliderSet,
attached_colliders: &RigidBodyColliders,
body_type: RigidBodyType,
position: &Isometry<f32>,
)
pub fn recompute_mass_properties_from_colliders( &mut self, colliders: &ColliderSet, attached_colliders: &RigidBodyColliders, body_type: RigidBodyType, position: &Isometry<f32>, )
Recompute the mass-properties of this rigid-bodies based on its currently attached colliders.
Sourcepub fn update_world_mass_properties(
&mut self,
body_type: RigidBodyType,
position: &Isometry<f32>,
)
pub fn update_world_mass_properties( &mut self, body_type: RigidBodyType, position: &Isometry<f32>, )
Update the world-space mass properties of self, taking into account the new position.
Trait Implementations§
Source§impl Clone for RigidBodyMassProps
impl Clone for RigidBodyMassProps
Source§fn clone(&self) -> RigidBodyMassProps
fn clone(&self) -> RigidBodyMassProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RigidBodyMassProps
impl Debug for RigidBodyMassProps
Source§impl Default for RigidBodyMassProps
impl Default for RigidBodyMassProps
Source§impl From<LockedAxes> for RigidBodyMassProps
impl From<LockedAxes> for RigidBodyMassProps
Source§fn from(flags: LockedAxes) -> Self
fn from(flags: LockedAxes) -> Self
Source§impl From<MassProperties> for RigidBodyMassProps
impl From<MassProperties> for RigidBodyMassProps
Source§fn from(local_mprops: MassProperties) -> Self
fn from(local_mprops: MassProperties) -> Self
Source§impl PartialEq for RigidBodyMassProps
impl PartialEq for RigidBodyMassProps
impl StructuralPartialEq for RigidBodyMassProps
Auto Trait Implementations§
impl Freeze for RigidBodyMassProps
impl RefUnwindSafe for RigidBodyMassProps
impl Send for RigidBodyMassProps
impl Sync for RigidBodyMassProps
impl Unpin for RigidBodyMassProps
impl UnwindSafe for RigidBodyMassProps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.