diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-02-21 21:34:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-21 21:34:30 +0100 |
| commit | a3190846b7fb5214ccd4a12a2f5e8150e323df12 (patch) | |
| tree | 2037da67d547490565e9720f7c3b3337026c5f8c /src/dynamics/solver/delta_vel.rs | |
| parent | ce3cf553c27d3fad6302dff7d196fccb953c2c33 (diff) | |
| parent | 15b165893c718a5606622b05b36f8041a429e30c (diff) | |
| download | rapier-a3190846b7fb5214ccd4a12a2f5e8150e323df12.tar.gz rapier-a3190846b7fb5214ccd4a12a2f5e8150e323df12.tar.bz2 rapier-a3190846b7fb5214ccd4a12a2f5e8150e323df12.zip | |
Merge pull request #290 from dimforge/solver-nan
Fix potential inf/NaN by using an epsilon for inv/simd_inv
Diffstat (limited to 'src/dynamics/solver/delta_vel.rs')
| -rw-r--r-- | src/dynamics/solver/delta_vel.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dynamics/solver/delta_vel.rs b/src/dynamics/solver/delta_vel.rs index 73f3c91..cfdb791 100644 --- a/src/dynamics/solver/delta_vel.rs +++ b/src/dynamics/solver/delta_vel.rs @@ -1,6 +1,6 @@ use crate::math::{AngVector, Vector, SPATIAL_DIM}; -use na::{DVectorSlice, DVectorSliceMut}; -use na::{Scalar, SimdRealField}; +use crate::utils::WReal; +use na::{DVectorSlice, DVectorSliceMut, Scalar}; use std::ops::{AddAssign, Sub}; #[derive(Copy, Clone, Debug, Default)] @@ -29,7 +29,7 @@ impl<N: Scalar + Copy> DeltaVel<N> { } } -impl<N: SimdRealField + Copy> DeltaVel<N> { +impl<N: WReal> DeltaVel<N> { pub fn zero() -> Self { Self { linear: na::zero(), @@ -38,14 +38,14 @@ impl<N: SimdRealField + Copy> DeltaVel<N> { } } -impl<N: SimdRealField + Copy> AddAssign for DeltaVel<N> { +impl<N: WReal> AddAssign for DeltaVel<N> { fn add_assign(&mut self, rhs: Self) { self.linear += rhs.linear; self.angular += rhs.angular; } } -impl<N: SimdRealField + Copy> Sub for DeltaVel<N> { +impl<N: WReal> Sub for DeltaVel<N> { type Output = Self; fn sub(self, rhs: Self) -> Self { |
