Make revolute joint actuation work properly even when SIMD is enabled.
This commit is contained in:
@@ -31,4 +31,9 @@ impl BallJoint {
|
||||
impulse,
|
||||
}
|
||||
}
|
||||
|
||||
/// Can a SIMD constraint be used for resolving this joint?
|
||||
pub fn supports_simd_constraints(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,9 @@ impl FixedJoint {
|
||||
impulse: SpacialVector::zeros(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Can a SIMD constraint be used for resolving this joint?
|
||||
pub fn supports_simd_constraints(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,3 +128,14 @@ pub struct Joint {
|
||||
/// The joint geometric parameters and impulse.
|
||||
pub params: JointParams,
|
||||
}
|
||||
|
||||
impl Joint {
|
||||
pub fn supports_simd_constraints(&self) -> bool {
|
||||
match &self.params {
|
||||
JointParams::RevoluteJoint(joint) => joint.supports_simd_constraints(),
|
||||
JointParams::PrismaticJoint(joint) => joint.supports_simd_constraints(),
|
||||
JointParams::FixedJoint(joint) => joint.supports_simd_constraints(),
|
||||
JointParams::BallJoint(joint) => joint.supports_simd_constraints(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,11 @@ impl PrismaticJoint {
|
||||
self.local_axis2
|
||||
}
|
||||
|
||||
/// Can a SIMD constraint be used for resolving this joint?
|
||||
pub fn supports_simd_constraints(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
// FIXME: precompute this?
|
||||
#[cfg(feature = "dim2")]
|
||||
pub(crate) fn local_frame1(&self) -> Isometry<Real> {
|
||||
|
||||
@@ -77,6 +77,12 @@ impl RevoluteJoint {
|
||||
}
|
||||
}
|
||||
|
||||
/// Can a SIMD constraint be used for resolving this joint?
|
||||
pub fn supports_simd_constraints(&self) -> bool {
|
||||
// SIMD revolute constraints don't support motors right now.
|
||||
self.motor_max_impulse == 0.0 || (self.motor_stiffness == 0.0 && self.motor_damping == 0.0)
|
||||
}
|
||||
|
||||
pub fn configure_motor_model(&mut self, model: SpringModel) {
|
||||
self.motor_model = model;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user