diff options
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs index da26b72..cf8dbc5 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | |||
@@ -80,10 +80,27 @@ public abstract class BSConstraint : IDisposable | |||
80 | bool ret = false; | 80 | bool ret = false; |
81 | if (m_enabled) | 81 | if (m_enabled) |
82 | { | 82 | { |
83 | // Recompute the internal transforms | ||
83 | BulletSimAPI.CalculateTransforms2(m_constraint.Ptr); | 84 | BulletSimAPI.CalculateTransforms2(m_constraint.Ptr); |
84 | ret = true; | 85 | ret = true; |
85 | } | 86 | } |
86 | return ret; | 87 | return ret; |
87 | } | 88 | } |
89 | |||
90 | // Reset this constraint making sure it has all its internal structures | ||
91 | // recomputed and is enabled and ready to go. | ||
92 | public virtual bool RecomputeConstraintVariables(float mass) | ||
93 | { | ||
94 | bool ret = false; | ||
95 | if (m_enabled) | ||
96 | { | ||
97 | ret = CalculateTransforms(); | ||
98 | if (ret) | ||
99 | { | ||
100 | BulletSimAPI.SetConstraintEnable2(m_constraint.Ptr, m_world.scene.NumericBool(true)); | ||
101 | } | ||
102 | } | ||
103 | return ret; | ||
104 | } | ||
88 | } | 105 | } |
89 | } | 106 | } |