From 702fd1e09473cede1458eef7b2c50cd39149a9f3 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 6 Nov 2012 12:07:22 -0800 Subject: BulletSim: only compute linkset mass when membership changes rather than everytime someone asks for it. --- OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs index 3a92f93..436e043 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs @@ -49,6 +49,9 @@ public abstract class BSLinkset switch ((int)physScene.Params.linksetImplementation) { + case (int)LinksetImplementation.Constraint: + ret = new BSLinksetConstraints(physScene, parent); + break; case (int)LinksetImplementation.Compound: ret = new BSLinksetCompound(physScene, parent); break; @@ -56,7 +59,7 @@ public abstract class BSLinkset // ret = new BSLinksetManual(physScene, parent); break; default: - ret = new BSLinksetConstraints(physScene, parent); + ret = new BSLinksetCompound(physScene, parent); break; } return ret; @@ -97,7 +100,6 @@ public abstract class BSLinkset { get { - m_mass = ComputeLinksetMass(); return m_mass; } } @@ -138,6 +140,7 @@ public abstract class BSLinkset // Don't add the root to its own linkset if (!IsRoot(child)) AddChildToLinkset(child); + m_mass = ComputeLinksetMass(); } return this; } @@ -156,6 +159,7 @@ public abstract class BSLinkset return this; } RemoveChildFromLinkset(child); + m_mass = ComputeLinksetMass(); } // The child is down to a linkset of just itself -- cgit v1.1