pub struct ImpulseSolver {
pub restitution: f32,
pub baumgarte_percent: f32,
pub slop: f32,
}Expand description
A mathematical solver for impulse-based constraint resolution.
Fields§
§restitution: f32Coefficient of restitution (bounciness).
baumgarte_percent: f32Percentage of penetration to resolve per frame (Baumgarte stabilization).
slop: f32Penetration allowance to avoid jitter.
Implementations§
Source§impl ImpulseSolver
impl ImpulseSolver
Sourcepub fn resolve(
&self,
a: VelocityState,
b: VelocityState,
manifold: &ContactManifold,
) -> (VelocityState, VelocityState)
pub fn resolve( &self, a: VelocityState, b: VelocityState, manifold: &ContactManifold, ) -> (VelocityState, VelocityState)
Resolves the collision between two bodies.
Returns the updated velocity states for both bodies.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImpulseSolver
impl RefUnwindSafe for ImpulseSolver
impl Send for ImpulseSolver
impl Sync for ImpulseSolver
impl Unpin for ImpulseSolver
impl UnwindSafe for ImpulseSolver
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