aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin
diff options
context:
space:
mode:
authorRobert Adams2012-11-06 12:07:22 -0800
committerRobert Adams2012-11-06 18:16:00 -0800
commit702fd1e09473cede1458eef7b2c50cd39149a9f3 (patch)
tree2ddc21251bde79638a75e5569b0421be0cea937e /OpenSim/Region/Physics/BulletSPlugin
parentBulletSim: Add separate linear and angular damping function calls. Add functi... (diff)
downloadopensim-SC_OLD-702fd1e09473cede1458eef7b2c50cd39149a9f3.zip
opensim-SC_OLD-702fd1e09473cede1458eef7b2c50cd39149a9f3.tar.gz
opensim-SC_OLD-702fd1e09473cede1458eef7b2c50cd39149a9f3.tar.bz2
opensim-SC_OLD-702fd1e09473cede1458eef7b2c50cd39149a9f3.tar.xz
BulletSim: only compute linkset mass when membership changes rather than everytime someone asks for it.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs8
1 files changed, 6 insertions, 2 deletions
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
49 49
50 switch ((int)physScene.Params.linksetImplementation) 50 switch ((int)physScene.Params.linksetImplementation)
51 { 51 {
52 case (int)LinksetImplementation.Constraint:
53 ret = new BSLinksetConstraints(physScene, parent);
54 break;
52 case (int)LinksetImplementation.Compound: 55 case (int)LinksetImplementation.Compound:
53 ret = new BSLinksetCompound(physScene, parent); 56 ret = new BSLinksetCompound(physScene, parent);
54 break; 57 break;
@@ -56,7 +59,7 @@ public abstract class BSLinkset
56 // ret = new BSLinksetManual(physScene, parent); 59 // ret = new BSLinksetManual(physScene, parent);
57 break; 60 break;
58 default: 61 default:
59 ret = new BSLinksetConstraints(physScene, parent); 62 ret = new BSLinksetCompound(physScene, parent);
60 break; 63 break;
61 } 64 }
62 return ret; 65 return ret;
@@ -97,7 +100,6 @@ public abstract class BSLinkset
97 { 100 {
98 get 101 get
99 { 102 {
100 m_mass = ComputeLinksetMass();
101 return m_mass; 103 return m_mass;
102 } 104 }
103 } 105 }
@@ -138,6 +140,7 @@ public abstract class BSLinkset
138 // Don't add the root to its own linkset 140 // Don't add the root to its own linkset
139 if (!IsRoot(child)) 141 if (!IsRoot(child))
140 AddChildToLinkset(child); 142 AddChildToLinkset(child);
143 m_mass = ComputeLinksetMass();
141 } 144 }
142 return this; 145 return this;
143 } 146 }
@@ -156,6 +159,7 @@ public abstract class BSLinkset
156 return this; 159 return this;
157 } 160 }
158 RemoveChildFromLinkset(child); 161 RemoveChildFromLinkset(child);
162 m_mass = ComputeLinksetMass();
159 } 163 }
160 164
161 // The child is down to a linkset of just itself 165 // The child is down to a linkset of just itself