Fix lever-arm handling in the revolute joint.

This commit is contained in:
Crozet Sébastien
2021-02-21 17:14:34 +01:00
parent dc8ccc0c30
commit f5515c3973
4 changed files with 73 additions and 54 deletions

View File

@@ -72,7 +72,7 @@ impl RevoluteJoint {
motor_max_impulse: Real::MAX,
motor_impulse: 0.0,
prev_axis1: *local_axis1,
motor_model: SpringModel::VelocityBased,
motor_model: SpringModel::default(),
motor_last_angle: 0.0,
}
}

View File

@@ -21,6 +21,12 @@ pub enum SpringModel {
ForceBased,
}
impl Default for SpringModel {
fn default() -> Self {
SpringModel::VelocityBased
}
}
impl SpringModel {
/// Combines the coefficients used for solving the spring equation.
///