aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs
index da26b72..25084d8 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs
@@ -80,10 +80,33 @@ 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 // m_world.scene.PhysicsLogging.Write("{0},BSConstraint.RecomputeConstraintVariables,taint,enabling,A={1},B={2}",
101 // BSScene.DetailLogZero, Body1.ID, Body2.ID);
102 BulletSimAPI.SetConstraintEnable2(m_constraint.Ptr, m_world.scene.NumericBool(true));
103 }
104 else
105 {
106 m_world.scene.Logger.ErrorFormat("[BULLETSIM CONSTRAINT] CalculateTransforms failed. A={0}, B={1}", Body1.ID, Body2.ID);
107 }
108 }
109 return ret;
110 }
88} 111}
89} 112}