pub struct AccumulatedImpulse {
pub linear: [f64; 3],
pub angular: [f64; 3],
}Expand description
Accumulated impulse for one body during one solve step.
Fields§
§linear: [f64; 3]Linear impulse (Δ momentum).
angular: [f64; 3]Angular impulse (Δ angular momentum).
Implementations§
Source§impl AccumulatedImpulse
impl AccumulatedImpulse
Sourcepub fn add_linear(&mut self, impulse: [f64; 3])
pub fn add_linear(&mut self, impulse: [f64; 3])
Add a linear impulse contribution.
Sourcepub fn add_angular(&mut self, impulse: [f64; 3])
pub fn add_angular(&mut self, impulse: [f64; 3])
Add an angular impulse contribution.
Sourcepub fn apply(&self, state: &mut RigidBodyState)
pub fn apply(&self, state: &mut RigidBodyState)
Apply the accumulated impulse to a body state.
Sourcepub fn linear_magnitude(&self) -> f64
pub fn linear_magnitude(&self) -> f64
L2 norm of the linear impulse.
Sourcepub fn angular_magnitude(&self) -> f64
pub fn angular_magnitude(&self) -> f64
L2 norm of the angular impulse.
Trait Implementations§
Source§impl Clone for AccumulatedImpulse
impl Clone for AccumulatedImpulse
Source§fn clone(&self) -> AccumulatedImpulse
fn clone(&self) -> AccumulatedImpulse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AccumulatedImpulse
impl Debug for AccumulatedImpulse
Source§impl Default for AccumulatedImpulse
impl Default for AccumulatedImpulse
Source§fn default() -> AccumulatedImpulse
fn default() -> AccumulatedImpulse
Returns the “default value” for a type. Read more
impl Copy for AccumulatedImpulse
Auto Trait Implementations§
impl Freeze for AccumulatedImpulse
impl RefUnwindSafe for AccumulatedImpulse
impl Send for AccumulatedImpulse
impl Sync for AccumulatedImpulse
impl Unpin for AccumulatedImpulse
impl UnsafeUnpin for AccumulatedImpulse
impl UnwindSafe for AccumulatedImpulse
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more