From 0703e5527fd95d86bb6621e61dbcb1a6e7f9329a Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sun, 16 Jan 2022 16:40:59 +0100 Subject: Fix some solver issues - Fix the wrong codepath taken by the solver for contacts involving a collider without parent. - Properly adress the non-linear treatment of the friction direction - Simplify the sleeping strategy - Add an impulse resolution multiplier --- src/dynamics/solver/delta_vel.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/dynamics/solver/delta_vel.rs') diff --git a/src/dynamics/solver/delta_vel.rs b/src/dynamics/solver/delta_vel.rs index 9160f2e..697fd24 100644 --- a/src/dynamics/solver/delta_vel.rs +++ b/src/dynamics/solver/delta_vel.rs @@ -1,7 +1,7 @@ use crate::math::{AngVector, Vector, SPATIAL_DIM}; use na::{DVectorSlice, DVectorSliceMut}; use na::{Scalar, SimdRealField}; -use std::ops::AddAssign; +use std::ops::{AddAssign, Sub}; #[derive(Copy, Clone, Debug)] #[repr(C)] @@ -44,3 +44,14 @@ impl AddAssign for DeltaVel { self.angular += rhs.angular; } } + +impl Sub for DeltaVel { + type Output = Self; + + fn sub(self, rhs: Self) -> Self { + DeltaVel { + linear: self.linear - rhs.linear, + angular: self.angular - rhs.angular, + } + } +} -- cgit