aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2014-10-10 05:12:30 -0700
committerRobert Adams2014-11-30 19:53:00 -0800
commit63d192f011c5232334759f8723c5e16197daff1b (patch)
treedf15af191bba7ddb1eb2f03aac1b599f07f93175
parentBulletSim: add BSLinkset.AllPartsComplete that checks of all linkset members ... (diff)
downloadopensim-SC_OLD-63d192f011c5232334759f8723c5e16197daff1b.zip
opensim-SC_OLD-63d192f011c5232334759f8723c5e16197daff1b.tar.gz
opensim-SC_OLD-63d192f011c5232334759f8723c5e16197daff1b.tar.bz2
opensim-SC_OLD-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.
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs2
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs37
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs10
3 files changed, 26 insertions, 23 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
index c0f8c2a..d37f29b 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
@@ -305,7 +305,7 @@ public abstract class BSLinkset
305 // This is turned on when the rebuild is requested and turned off when 305 // This is turned on when the rebuild is requested and turned off when
306 // the rebuild is complete. Used to limit modifications to the 306 // the rebuild is complete. Used to limit modifications to the
307 // linkset parameters while the linkset is in an intermediate state. 307 // linkset parameters while the linkset is in an intermediate state.
308 // Protected by a "lock(this)" on the BSLinkset object 308 // Protected by a "lock(m_linsetActivityLock)" on the BSLinkset object
309 public bool RebuildScheduled { get; protected set; } 309 public bool RebuildScheduled { get; protected set; }
310 310
311 // The object is going dynamic (physical). Do any setup necessary 311 // The object is going dynamic (physical). Do any setup necessary
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,
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
index c293e8c..430d645 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
@@ -54,16 +54,6 @@ public class BSPrimLinkable : BSPrimDisplaced
54 54
55 public BSLinkset.LinksetImplementation LinksetType { get; set; } 55 public BSLinkset.LinksetImplementation LinksetType { get; set; }
56 56
57 public override bool IsIncomplete
58 {
59 get
60 {
61 // A linkset is incomplete when base objects are incomplete, waiting for assets,
62 // or being rebuilt.
63 return (base.IsIncomplete || Linkset.RebuildScheduled || !Linkset.AllPartsComplete);
64 }
65 }
66
67 public BSPrimLinkable(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size, 57 public BSPrimLinkable(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
68 OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical) 58 OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
69 : base(localID, primName, parent_scene, pos, size, rotation, pbs, pisPhysical) 59 : base(localID, primName, parent_scene, pos, size, rotation, pbs, pisPhysical)