Update to nalgebra 0.29

This commit is contained in:
Sébastien Crozet
2021-08-08 18:39:04 +02:00
committed by Sébastien Crozet
parent 13aebc4242
commit 57aec69c1e
6 changed files with 31 additions and 28 deletions

View File

@@ -9,7 +9,7 @@ pub(crate) struct DeltaVel<N: Scalar + Copy> {
pub angular: AngVector<N>,
}
impl<N: SimdRealField> DeltaVel<N> {
impl<N: SimdRealField + Copy> DeltaVel<N> {
pub fn zero() -> Self {
Self {
linear: na::zero(),
@@ -18,7 +18,7 @@ impl<N: SimdRealField> DeltaVel<N> {
}
}
impl<N: SimdRealField> AddAssign for DeltaVel<N> {
impl<N: SimdRealField + Copy> AddAssign for DeltaVel<N> {
fn add_assign(&mut self, rhs: Self) {
self.linear += rhs.linear;
self.angular += rhs.angular;

View File

@@ -1,4 +1,7 @@
use super::{DeltaVel, ParallelInteractionGroups, ParallelVelocitySolver};
use std::sync::atomic::{AtomicUsize, Ordering};
use rayon::Scope;
use crate::data::{BundleSet, ComponentSet, ComponentSetMut};
use crate::dynamics::solver::{
AnyJointPositionConstraint, AnyJointVelocityConstraint, AnyPositionConstraint,
@@ -12,8 +15,8 @@ use crate::dynamics::{
use crate::geometry::{ContactManifold, ContactManifoldIndex};
use crate::math::{Isometry, Real};
use crate::utils::WAngularInertia;
use rayon::Scope;
use std::sync::atomic::{AtomicUsize, Ordering};
use super::{DeltaVel, ParallelInteractionGroups, ParallelVelocitySolver};
#[macro_export]
#[doc(hidden)]

View File

@@ -373,8 +373,8 @@ pub(crate) fn compute_tangent_contact_directions<N>(
linvel2: &Vector<N>,
) -> ([Vector<N>; DIM - 1], na::UnitComplex<N>)
where
N: na::SimdRealField,
N::Element: na::RealField,
N: na::SimdRealField + Copy,
N::Element: na::RealField + Copy,
Vector<N>: WBasis,
{
use na::SimdValue;

View File

@@ -4,7 +4,7 @@ use crate::utils::{WBasis, WDot};
use na::SimdRealField;
#[derive(Copy, Clone, Debug)]
pub(crate) struct VelocityConstraintTangentPart<N: SimdRealField> {
pub(crate) struct VelocityConstraintTangentPart<N: SimdRealField + Copy> {
pub gcross1: [AngVector<N>; DIM - 1],
pub gcross2: [AngVector<N>; DIM - 1],
pub rhs: [N; DIM - 1],
@@ -15,7 +15,7 @@ pub(crate) struct VelocityConstraintTangentPart<N: SimdRealField> {
pub r: [N; DIM - 1],
}
impl<N: SimdRealField> VelocityConstraintTangentPart<N> {
impl<N: SimdRealField + Copy> VelocityConstraintTangentPart<N> {
#[cfg(any(not(target_arch = "wasm32"), feature = "simd-is-enabled"))]
fn zero() -> Self {
Self {
@@ -40,7 +40,7 @@ impl<N: SimdRealField> VelocityConstraintTangentPart<N> {
mj_lambda2: &mut DeltaVel<N>,
) where
AngVector<N>: WDot<AngVector<N>, Result = N>,
N::Element: SimdRealField,
N::Element: SimdRealField + Copy,
{
for j in 0..DIM - 1 {
mj_lambda1.linear += tangents1[j] * (im1 * self.impulse[j]);
@@ -62,7 +62,7 @@ impl<N: SimdRealField> VelocityConstraintTangentPart<N> {
mj_lambda2: &mut DeltaVel<N>,
) where
AngVector<N>: WDot<AngVector<N>, Result = N>,
N::Element: SimdRealField,
N::Element: SimdRealField + Copy,
{
#[cfg(feature = "dim2")]
{
@@ -121,7 +121,7 @@ impl<N: SimdRealField> VelocityConstraintTangentPart<N> {
}
#[derive(Copy, Clone, Debug)]
pub(crate) struct VelocityConstraintNormalPart<N: SimdRealField> {
pub(crate) struct VelocityConstraintNormalPart<N: SimdRealField + Copy> {
pub gcross1: AngVector<N>,
pub gcross2: AngVector<N>,
pub rhs: N,
@@ -129,7 +129,7 @@ pub(crate) struct VelocityConstraintNormalPart<N: SimdRealField> {
pub r: N,
}
impl<N: SimdRealField> VelocityConstraintNormalPart<N> {
impl<N: SimdRealField + Copy> VelocityConstraintNormalPart<N> {
#[cfg(any(not(target_arch = "wasm32"), feature = "simd-is-enabled"))]
fn zero() -> Self {
Self {
@@ -187,12 +187,12 @@ impl<N: SimdRealField> VelocityConstraintNormalPart<N> {
}
#[derive(Copy, Clone, Debug)]
pub(crate) struct VelocityConstraintElement<N: SimdRealField> {
pub(crate) struct VelocityConstraintElement<N: SimdRealField + Copy> {
pub normal_part: VelocityConstraintNormalPart<N>,
pub tangent_part: VelocityConstraintTangentPart<N>,
}
impl<N: SimdRealField> VelocityConstraintElement<N> {
impl<N: SimdRealField + Copy> VelocityConstraintElement<N> {
#[cfg(any(not(target_arch = "wasm32"), feature = "simd-is-enabled"))]
pub fn zero() -> Self {
Self {
@@ -213,7 +213,7 @@ impl<N: SimdRealField> VelocityConstraintElement<N> {
) where
Vector<N>: WBasis,
AngVector<N>: WDot<AngVector<N>, Result = N>,
N::Element: SimdRealField,
N::Element: SimdRealField + Copy,
{
#[cfg(feature = "dim3")]
let tangents1 = [tangent1, &dir1.cross(&tangent1)];
@@ -243,7 +243,7 @@ impl<N: SimdRealField> VelocityConstraintElement<N> {
) where
Vector<N>: WBasis,
AngVector<N>: WDot<AngVector<N>, Result = N>,
N::Element: SimdRealField,
N::Element: SimdRealField + Copy,
{
// Solve friction.
#[cfg(feature = "dim3")]

View File

@@ -4,7 +4,7 @@ use crate::utils::{WBasis, WDot};
use na::SimdRealField;
#[derive(Copy, Clone, Debug)]
pub(crate) struct VelocityGroundConstraintTangentPart<N: SimdRealField> {
pub(crate) struct VelocityGroundConstraintTangentPart<N: SimdRealField + Copy> {
pub gcross2: [AngVector<N>; DIM - 1],
pub rhs: [N; DIM - 1],
#[cfg(feature = "dim2")]
@@ -14,7 +14,7 @@ pub(crate) struct VelocityGroundConstraintTangentPart<N: SimdRealField> {
pub r: [N; DIM - 1],
}
impl<N: SimdRealField> VelocityGroundConstraintTangentPart<N> {
impl<N: SimdRealField + Copy> VelocityGroundConstraintTangentPart<N> {
#[cfg(any(not(target_arch = "wasm32"), feature = "simd-is-enabled"))]
fn zero() -> Self {
Self {
@@ -50,7 +50,7 @@ impl<N: SimdRealField> VelocityGroundConstraintTangentPart<N> {
mj_lambda2: &mut DeltaVel<N>,
) where
AngVector<N>: WDot<AngVector<N>, Result = N>,
N::Element: SimdRealField,
N::Element: SimdRealField + Copy,
{
#[cfg(feature = "dim2")]
{
@@ -96,14 +96,14 @@ impl<N: SimdRealField> VelocityGroundConstraintTangentPart<N> {
}
#[derive(Copy, Clone, Debug)]
pub(crate) struct VelocityGroundConstraintNormalPart<N: SimdRealField> {
pub(crate) struct VelocityGroundConstraintNormalPart<N: SimdRealField + Copy> {
pub gcross2: AngVector<N>,
pub rhs: N,
pub impulse: N,
pub r: N,
}
impl<N: SimdRealField> VelocityGroundConstraintNormalPart<N> {
impl<N: SimdRealField + Copy> VelocityGroundConstraintNormalPart<N> {
#[cfg(any(not(target_arch = "wasm32"), feature = "simd-is-enabled"))]
fn zero() -> Self {
Self {
@@ -137,12 +137,12 @@ impl<N: SimdRealField> VelocityGroundConstraintNormalPart<N> {
}
#[derive(Copy, Clone, Debug)]
pub(crate) struct VelocityGroundConstraintElement<N: SimdRealField> {
pub(crate) struct VelocityGroundConstraintElement<N: SimdRealField + Copy> {
pub normal_part: VelocityGroundConstraintNormalPart<N>,
pub tangent_part: VelocityGroundConstraintTangentPart<N>,
}
impl<N: SimdRealField> VelocityGroundConstraintElement<N> {
impl<N: SimdRealField + Copy> VelocityGroundConstraintElement<N> {
#[cfg(any(not(target_arch = "wasm32"), feature = "simd-is-enabled"))]
pub fn zero() -> Self {
Self {
@@ -161,7 +161,7 @@ impl<N: SimdRealField> VelocityGroundConstraintElement<N> {
) where
Vector<N>: WBasis,
AngVector<N>: WDot<AngVector<N>, Result = N>,
N::Element: SimdRealField,
N::Element: SimdRealField + Copy,
{
#[cfg(feature = "dim3")]
let tangents1 = [tangent1, &dir1.cross(&tangent1)];
@@ -185,7 +185,7 @@ impl<N: SimdRealField> VelocityGroundConstraintElement<N> {
) where
Vector<N>: WBasis,
AngVector<N>: WDot<AngVector<N>, Result = N>,
N::Element: SimdRealField,
N::Element: SimdRealField + Copy,
{
// Solve friction.
#[cfg(feature = "dim3")]