Fix regression causing invalid contacts to be solved.

This commit is contained in:
Crozet Sébastien
2021-03-07 17:34:49 +01:00
parent 0e4393ba9e
commit 152ada67ec
6 changed files with 14 additions and 8 deletions

View File

@@ -286,7 +286,7 @@ impl VelocityConstraint {
let mut mj_lambda2 = DeltaVel::zero(); let mut mj_lambda2 = DeltaVel::zero();
VelocityConstraintElement::warmstart_group( VelocityConstraintElement::warmstart_group(
&self.elements, &self.elements[..self.num_contacts as usize],
&self.dir1, &self.dir1,
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
&self.tangent1, &self.tangent1,
@@ -305,7 +305,7 @@ impl VelocityConstraint {
let mut mj_lambda2 = mj_lambdas[self.mj_lambda2 as usize]; let mut mj_lambda2 = mj_lambdas[self.mj_lambda2 as usize];
VelocityConstraintElement::solve_group( VelocityConstraintElement::solve_group(
&mut self.elements, &mut self.elements[..self.num_contacts as usize],
&self.dir1, &self.dir1,
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
&self.tangent1, &self.tangent1,

View File

@@ -30,6 +30,7 @@ impl<N: SimdRealField> VelocityConstraintTangentPart<N> {
} }
} }
#[inline]
pub fn warmstart( pub fn warmstart(
&self, &self,
tangents1: [&Vector<N>; DIM - 1], tangents1: [&Vector<N>; DIM - 1],
@@ -50,6 +51,7 @@ impl<N: SimdRealField> VelocityConstraintTangentPart<N> {
} }
} }
#[inline]
pub fn solve( pub fn solve(
&mut self, &mut self,
tangents1: [&Vector<N>; DIM - 1], tangents1: [&Vector<N>; DIM - 1],
@@ -193,6 +195,7 @@ impl<N: SimdRealField> VelocityConstraintElement<N> {
} }
} }
#[inline]
pub fn warmstart_group( pub fn warmstart_group(
elements: &[Self], elements: &[Self],
dir1: &Vector<N>, dir1: &Vector<N>,
@@ -221,6 +224,7 @@ impl<N: SimdRealField> VelocityConstraintElement<N> {
} }
} }
#[inline]
pub fn solve_group( pub fn solve_group(
elements: &mut [Self], elements: &mut [Self],
dir1: &Vector<N>, dir1: &Vector<N>,

View File

@@ -217,7 +217,7 @@ impl WVelocityConstraint {
}; };
VelocityConstraintElement::warmstart_group( VelocityConstraintElement::warmstart_group(
&self.elements, &self.elements[..self.num_contacts as usize],
&self.dir1, &self.dir1,
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
&self.tangent1, &self.tangent1,
@@ -257,7 +257,7 @@ impl WVelocityConstraint {
}; };
VelocityConstraintElement::solve_group( VelocityConstraintElement::solve_group(
&mut self.elements, &mut self.elements[..self.num_contacts as usize],
&self.dir1, &self.dir1,
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
&self.tangent1, &self.tangent1,

View File

@@ -196,7 +196,7 @@ impl VelocityGroundConstraint {
let mut mj_lambda2 = DeltaVel::zero(); let mut mj_lambda2 = DeltaVel::zero();
VelocityGroundConstraintElement::warmstart_group( VelocityGroundConstraintElement::warmstart_group(
&self.elements, &self.elements[..self.num_contacts as usize],
&self.dir1, &self.dir1,
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
&self.tangent1, &self.tangent1,
@@ -212,7 +212,7 @@ impl VelocityGroundConstraint {
let mut mj_lambda2 = mj_lambdas[self.mj_lambda2 as usize]; let mut mj_lambda2 = mj_lambdas[self.mj_lambda2 as usize];
VelocityGroundConstraintElement::solve_group( VelocityGroundConstraintElement::solve_group(
&mut self.elements, &mut self.elements[..self.num_contacts as usize],
&self.dir1, &self.dir1,
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
&self.tangent1, &self.tangent1,

View File

@@ -28,6 +28,7 @@ impl<N: SimdRealField> VelocityGroundConstraintTangentPart<N> {
} }
} }
#[inline]
pub fn warmstart( pub fn warmstart(
&self, &self,
tangents1: [&Vector<N>; DIM - 1], tangents1: [&Vector<N>; DIM - 1],
@@ -40,6 +41,7 @@ impl<N: SimdRealField> VelocityGroundConstraintTangentPart<N> {
} }
} }
#[inline]
pub fn solve( pub fn solve(
&mut self, &mut self,
tangents1: [&Vector<N>; DIM - 1], tangents1: [&Vector<N>; DIM - 1],

View File

@@ -194,7 +194,7 @@ impl WVelocityGroundConstraint {
}; };
VelocityGroundConstraintElement::warmstart_group( VelocityGroundConstraintElement::warmstart_group(
&self.elements, &self.elements[..self.num_contacts as usize],
&self.dir1, &self.dir1,
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
&self.tangent1, &self.tangent1,
@@ -219,7 +219,7 @@ impl WVelocityGroundConstraint {
}; };
VelocityGroundConstraintElement::solve_group( VelocityGroundConstraintElement::solve_group(
&mut self.elements, &mut self.elements[..self.num_contacts as usize],
&self.dir1, &self.dir1,
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
&self.tangent1, &self.tangent1,