aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorRobert Adams2013-08-07 11:18:23 -0700
committerRobert Adams2013-09-11 09:11:46 -0700
commitdff0fb56902f62b070ec6fd05769babfad32ed2e (patch)
treebadef88245dcc6ee3b8bf7d9373da31396e1aa44 /OpenSim/Region/Physics
parentBulletSim: initial implementation of physChangeLinkFixed that resets a linkse... (diff)
downloadopensim-SC_OLD-dff0fb56902f62b070ec6fd05769babfad32ed2e.zip
opensim-SC_OLD-dff0fb56902f62b070ec6fd05769babfad32ed2e.tar.gz
opensim-SC_OLD-dff0fb56902f62b070ec6fd05769babfad32ed2e.tar.bz2
opensim-SC_OLD-dff0fb56902f62b070ec6fd05769babfad32ed2e.tar.xz
BulletSim: Linkset.Refresh() calls internal ScheduleRebuild() to recreate the linkset physics at next PostTaint time. Replace the existing calls to ScheduleRebuild to be calls to Refresh(). This allows external routines to make changes to parameters and then cause the linkset to rebuild.
Diffstat (limited to 'OpenSim/Region/Physics')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs17
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs11
2 files changed, 14 insertions, 14 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
index 47ab842..8f12189 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
@@ -90,10 +90,9 @@ public sealed class BSLinksetCompound : BSLinkset
90 // its internal properties. 90 // its internal properties.
91 public override void Refresh(BSPrimLinkable requestor) 91 public override void Refresh(BSPrimLinkable requestor)
92 { 92 {
93 base.Refresh(requestor);
94
95 // Something changed so do the rebuilding thing 93 // Something changed so do the rebuilding thing
96 // ScheduleRebuild(); 94 ScheduleRebuild(requestor);
95 base.Refresh(requestor);
97 } 96 }
98 97
99 // Schedule a refresh to happen after all the other taint processing. 98 // Schedule a refresh to happen after all the other taint processing.
@@ -127,7 +126,7 @@ public sealed class BSLinksetCompound : BSLinkset
127 if (IsRoot(child)) 126 if (IsRoot(child))
128 { 127 {
129 // The root is going dynamic. Rebuild the linkset so parts and mass get computed properly. 128 // The root is going dynamic. Rebuild the linkset so parts and mass get computed properly.
130 ScheduleRebuild(LinksetRoot); 129 Refresh(LinksetRoot);
131 } 130 }
132 return ret; 131 return ret;
133 } 132 }
@@ -144,7 +143,7 @@ public sealed class BSLinksetCompound : BSLinkset
144 if (IsRoot(child)) 143 if (IsRoot(child))
145 { 144 {
146 // Schedule a rebuild to verify that the root shape is set to the real shape. 145 // Schedule a rebuild to verify that the root shape is set to the real shape.
147 ScheduleRebuild(LinksetRoot); 146 Refresh(LinksetRoot);
148 } 147 }
149 return ret; 148 return ret;
150 } 149 }
@@ -227,7 +226,7 @@ public sealed class BSLinksetCompound : BSLinkset
227 // there will already be a rebuild scheduled. 226 // there will already be a rebuild scheduled.
228 DetailLog("{0},BSLinksetCompound.UpdateProperties,couldNotUpdateChild.schedulingRebuild,whichUpdated={1}", 227 DetailLog("{0},BSLinksetCompound.UpdateProperties,couldNotUpdateChild.schedulingRebuild,whichUpdated={1}",
229 updated.LocalID, whichUpdated); 228 updated.LocalID, whichUpdated);
230 ScheduleRebuild(updated); 229 Refresh(updated);
231 } 230 }
232 } 231 }
233 } 232 }
@@ -245,7 +244,7 @@ public sealed class BSLinksetCompound : BSLinkset
245 DetailLog("{0},BSLinksetCompound.RemoveDependencies,refreshIfChild,rID={1},rBody={2},isRoot={3}", 244 DetailLog("{0},BSLinksetCompound.RemoveDependencies,refreshIfChild,rID={1},rBody={2},isRoot={3}",
246 child.LocalID, LinksetRoot.LocalID, LinksetRoot.PhysBody, IsRoot(child)); 245 child.LocalID, LinksetRoot.LocalID, LinksetRoot.PhysBody, IsRoot(child));
247 246
248 ScheduleRebuild(child); 247 Refresh(child);
249 248
250 return ret; 249 return ret;
251 } 250 }
@@ -263,7 +262,7 @@ public sealed class BSLinksetCompound : BSLinkset
263 DetailLog("{0},BSLinksetCompound.AddChildToLinkset,call,child={1}", LinksetRoot.LocalID, child.LocalID); 262 DetailLog("{0},BSLinksetCompound.AddChildToLinkset,call,child={1}", LinksetRoot.LocalID, child.LocalID);
264 263
265 // Rebuild the compound shape with the new child shape included 264 // Rebuild the compound shape with the new child shape included
266 ScheduleRebuild(child); 265 Refresh(child);
267 } 266 }
268 return; 267 return;
269 } 268 }
@@ -292,7 +291,7 @@ public sealed class BSLinksetCompound : BSLinkset
292 else 291 else
293 { 292 {
294 // Rebuild the compound shape with the child removed 293 // Rebuild the compound shape with the child removed
295 ScheduleRebuild(LinksetRoot); 294 Refresh(LinksetRoot);
296 } 295 }
297 } 296 }
298 return; 297 return;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
index f3b70c3..db323c2 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
@@ -158,6 +158,7 @@ public sealed class BSLinksetConstraints : BSLinkset
158 // refresh will happen once after all the other taints are applied. 158 // refresh will happen once after all the other taints are applied.
159 public override void Refresh(BSPrimLinkable requestor) 159 public override void Refresh(BSPrimLinkable requestor)
160 { 160 {
161 ScheduleRebuild(requestor);
161 base.Refresh(requestor); 162 base.Refresh(requestor);
162 163
163 } 164 }
@@ -194,7 +195,7 @@ public sealed class BSLinksetConstraints : BSLinkset
194 if (IsRoot(child)) 195 if (IsRoot(child))
195 { 196 {
196 // The root is going dynamic. Rebuild the linkset so parts and mass get computed properly. 197 // The root is going dynamic. Rebuild the linkset so parts and mass get computed properly.
197 ScheduleRebuild(LinksetRoot); 198 Refresh(LinksetRoot);
198 } 199 }
199 return ret; 200 return ret;
200 } 201 }
@@ -213,7 +214,7 @@ public sealed class BSLinksetConstraints : BSLinkset
213 if (IsRoot(child)) 214 if (IsRoot(child))
214 { 215 {
215 // Schedule a rebuild to verify that the root shape is set to the real shape. 216 // Schedule a rebuild to verify that the root shape is set to the real shape.
216 ScheduleRebuild(LinksetRoot); 217 Refresh(LinksetRoot);
217 } 218 }
218 return ret; 219 return ret;
219 } 220 }
@@ -241,7 +242,7 @@ public sealed class BSLinksetConstraints : BSLinkset
241 // Just undo all the constraints for this linkset. Rebuild at the end of the step. 242 // Just undo all the constraints for this linkset. Rebuild at the end of the step.
242 ret = PhysicallyUnlinkAllChildrenFromRoot(LinksetRoot); 243 ret = PhysicallyUnlinkAllChildrenFromRoot(LinksetRoot);
243 // Cause the constraints, et al to be rebuilt before the next simulation step. 244 // Cause the constraints, et al to be rebuilt before the next simulation step.
244 ScheduleRebuild(LinksetRoot); 245 Refresh(LinksetRoot);
245 } 246 }
246 return ret; 247 return ret;
247 } 248 }
@@ -259,7 +260,7 @@ public sealed class BSLinksetConstraints : BSLinkset
259 DetailLog("{0},BSLinksetConstraints.AddChildToLinkset,call,child={1}", LinksetRoot.LocalID, child.LocalID); 260 DetailLog("{0},BSLinksetConstraints.AddChildToLinkset,call,child={1}", LinksetRoot.LocalID, child.LocalID);
260 261
261 // Cause constraints and assorted properties to be recomputed before the next simulation step. 262 // Cause constraints and assorted properties to be recomputed before the next simulation step.
262 ScheduleRebuild(LinksetRoot); 263 Refresh(LinksetRoot);
263 } 264 }
264 return; 265 return;
265 } 266 }
@@ -283,7 +284,7 @@ public sealed class BSLinksetConstraints : BSLinkset
283 PhysicallyUnlinkAChildFromRoot(rootx, childx); 284 PhysicallyUnlinkAChildFromRoot(rootx, childx);
284 }); 285 });
285 // See that the linkset parameters are recomputed at the end of the taint time. 286 // See that the linkset parameters are recomputed at the end of the taint time.
286 ScheduleRebuild(LinksetRoot); 287 Refresh(LinksetRoot);
287 } 288 }
288 else 289 else
289 { 290 {