rigidbody: Invert spring damping range
authorSergej Reich <sergej.reich@googlemail.com>
Tue, 5 Feb 2013 21:51:17 +0000 (21:51 +0000)
committerSergej Reich <sergej.reich@googlemail.com>
Tue, 5 Feb 2013 21:51:17 +0000 (21:51 +0000)
Before 1 was no damping, which is inconsistent with the rest of the
simulation.

intern/rigidbody/rb_bullet_api.cpp

index c4a4532..4a3367a 100644 (file)
@@ -915,7 +915,8 @@ void RB_constraint_set_damping_6dof_spring(rbConstraint *con, float axis, float
 {
        btGeneric6DofSpringConstraint *constraint = reinterpret_cast<btGeneric6DofSpringConstraint*>(con);
        
-       constraint->setDamping(axis, damping);
+       // invert damping range so that 0 = no damping
+       constraint->setDamping(axis, 1.0f - damping);
 }
 
 void RB_constraint_set_spring_6dof_spring(rbConstraint *con, float axis, int enable)