From 41a943bfd01a8d9463a6621c1f248829637ccb28 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 3 Oct 2014 10:27:48 -0700 Subject: BulletSim: add BSLinkset.AllPartsComplete that checks of all linkset members are not Incomplete and not waiting for assets. Change BSPrimLinkable to use AllPartsComplete. --- OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 17 +++++++++++++++++ .../Region/Physics/BulletSPlugin/BSPrimLinkable.cs | 22 +--------------------- 2 files changed, 18 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs index e7b10fe..c0f8c2a 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs @@ -316,6 +316,23 @@ public abstract class BSLinkset // Called at taint-time! public abstract bool MakeDynamic(BSPrimLinkable child); + public virtual bool AllPartsComplete + { + get { + bool ret = true; + this.ForEachMember((member) => + { + if (member.IsIncomplete || member.PrimAssetState == BSPhysObject.PrimAssetCondition.Waiting) + { + ret = false; + return true; // exit loop + } + return false; // continue loop + }); + return ret; + } + } + // The object is going static (non-physical). Do any setup necessary // for a static linkset. // Return 'true' if any properties updated on the passed object. diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs index 9301e52..c293e8c 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs @@ -60,27 +60,7 @@ public class BSPrimLinkable : BSPrimDisplaced { // A linkset is incomplete when base objects are incomplete, waiting for assets, // or being rebuilt. - bool ret = false; - if (base.IsIncomplete || Linkset.RebuildScheduled) - { - ret = true; - } - else - { - if (Linkset.IsRoot(this)) - { - Linkset.ForEachMember((member) => - { - if (member.PrimAssetState == PrimAssetCondition.Waiting) - { - ret = true; - return true; - } - return false; - }); - } - } - return ret; + return (base.IsIncomplete || Linkset.RebuildScheduled || !Linkset.AllPartsComplete); } } -- cgit v1.1