aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
diff options
context:
space:
mode:
authorRobert Adams2014-10-10 05:12:30 -0700
committerRobert Adams2014-11-30 19:53:00 -0800
commit63d192f011c5232334759f8723c5e16197daff1b (patch)
treedf15af191bba7ddb1eb2f03aac1b599f07f93175 /OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
parentBulletSim: add BSLinkset.AllPartsComplete that checks of all linkset members ... (diff)
downloadopensim-SC-63d192f011c5232334759f8723c5e16197daff1b.zip
opensim-SC-63d192f011c5232334759f8723c5e16197daff1b.tar.gz
opensim-SC-63d192f011c5232334759f8723c5e16197daff1b.tar.bz2
opensim-SC-63d192f011c5232334759f8723c5e16197daff1b.tar.xz
BulletSim: Remove linkset 'Incomplete' flag as its meaning couldn't be made clear. Add 'InternalScheduleRebuild() CHange rebuild code to call InternalScheduleRebuild() rather than ForceRebuild() to limit the scope of the changes made by the linkset.
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs37
1 files changed, 25 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
index 582ba5b..049f825 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
@@ -106,22 +106,35 @@ public sealed class BSLinksetCompound : BSLinkset
106 // When rebuilding, it is possible to set properties that would normally require a rebuild. 106 // When rebuilding, it is possible to set properties that would normally require a rebuild.
107 // If already rebuilding, don't request another rebuild. 107 // If already rebuilding, don't request another rebuild.
108 // If a linkset with just a root prim (simple non-linked prim) don't bother rebuilding. 108 // If a linkset with just a root prim (simple non-linked prim) don't bother rebuilding.
109 lock (this) 109 lock (m_linksetActivityLock)
110 { 110 {
111 if (!RebuildScheduled) 111 if (!RebuildScheduled && !Rebuilding && HasAnyChildren)
112 { 112 {
113 if (!Rebuilding && HasAnyChildren) 113 InternalScheduleRebuild(requestor);
114 }
115 }
116 }
117
118 private void InternalScheduleRebuild(BSPrimLinkable requestor)
119 {
120 RebuildScheduled = true;
121 m_physicsScene.PostTaintObject("BSLinksetCompound.ScheduleRebuild", LinksetRoot.LocalID, delegate()
122 {
123 if (HasAnyChildren)
124 {
125 if (this.AllPartsComplete)
114 { 126 {
115 RebuildScheduled = true; 127 RecomputeLinksetCompound();
116 m_physicsScene.PostTaintObject("BSLinksetCompound.ScheduleRebuild", LinksetRoot.LocalID, delegate() 128 }
117 { 129 else
118 if (HasAnyChildren) 130 {
119 RecomputeLinksetCompound(); 131 DetailLog("{0},BSLinksetCompound.InternalScheduleRebuild,,rescheduling because not all children complete",
120 RebuildScheduled = false; 132 requestor.LocalID);
121 }); 133 InternalScheduleRebuild(requestor);
122 } 134 }
123 } 135 }
124 } 136 RebuildScheduled = false;
137 });
125 } 138 }
126 139
127 // The object is going dynamic (physical). Do any setup necessary for a dynamic linkset. 140 // The object is going dynamic (physical). Do any setup necessary for a dynamic linkset.
@@ -412,7 +425,7 @@ public sealed class BSLinksetCompound : BSLinkset
412 // Just skip this linkset for the moment and cause the shape to be rebuilt next tick. 425 // Just skip this linkset for the moment and cause the shape to be rebuilt next tick.
413 // One problem might be that the shape is broken somehow and it never becomes completely 426 // One problem might be that the shape is broken somehow and it never becomes completely
414 // available. This might cause the rebuild to happen over and over. 427 // available. This might cause the rebuild to happen over and over.
415 LinksetRoot.ForceBodyShapeRebuild(false); 428 InternalScheduleRebuild(LinksetRoot);
416 DetailLog("{0},BSLinksetCompound.RecomputeLinksetCompound,addChildWithNoShape,indx={1},cShape={2},offPos={3},offRot={4}", 429 DetailLog("{0},BSLinksetCompound.RecomputeLinksetCompound,addChildWithNoShape,indx={1},cShape={2},offPos={3},offRot={4}",
417 LinksetRoot.LocalID, cPrim.LinksetChildIndex, childShape, offsetPos, offsetRot); 430 LinksetRoot.LocalID, cPrim.LinksetChildIndex, childShape, offsetPos, offsetRot);
418 // Output an annoying warning. It should only happen once but if it keeps coming out, 431 // Output an annoying warning. It should only happen once but if it keeps coming out,