From c1c1d48af15b4ac0ed5951816f6225a74ffa6eba Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 14 Aug 2012 16:24:34 -0700 Subject: BulletSim: add BSConstraint.RecomputConstraintVariables for the recomputation after linksets changed, etc --- OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs') 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 bool ret = false; if (m_enabled) { + // Recompute the internal transforms BulletSimAPI.CalculateTransforms2(m_constraint.Ptr); ret = true; } return ret; } + + // Reset this constraint making sure it has all its internal structures + // recomputed and is enabled and ready to go. + public virtual bool RecomputeConstraintVariables(float mass) + { + bool ret = false; + if (m_enabled) + { + ret = CalculateTransforms(); + if (ret) + { + BulletSimAPI.SetConstraintEnable2(m_constraint.Ptr, m_world.scene.NumericBool(true)); + } + } + return ret; + } } } -- cgit v1.1