From cf85ade81e38e692fe99c71386ab2c306ab77319 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 2 Oct 2014 18:45:36 -0700 Subject: BulletSim: add shape and linkset rebuild scheduled flags. Add BSPrim.Incomplete flag based on rebuild flags to say when an object is being rebuilt. --- .../Physics/BulletSPlugin/BSLinksetConstraints.cs | 28 ++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs index b0a5ef1..4384cdc 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs @@ -212,20 +212,28 @@ public sealed class BSLinksetConstraints : BSLinkset // When rebuilding, it is possible to set properties that would normally require a rebuild. // If already rebuilding, don't request another rebuild. // If a linkset with just a root prim (simple non-linked prim) don't bother rebuilding. - if (!Rebuilding && HasAnyChildren) + lock (this) { - // Queue to happen after all the other taint processing - m_physicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate() + if (!RebuildScheduled) { - if (HasAnyChildren) + if (!Rebuilding && HasAnyChildren) { - // Constraints that have not been changed are not rebuild but make sure - // the constraint of the requestor is rebuilt. - PhysicallyUnlinkAChildFromRoot(LinksetRoot, requestor); - // Rebuild the linkset and all its constraints. - RecomputeLinksetConstraints(); + RebuildScheduled = true; + // Queue to happen after all the other taint processing + m_physicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate() + { + if (HasAnyChildren) + { + // Constraints that have not been changed are not rebuild but make sure + // the constraint of the requestor is rebuilt. + PhysicallyUnlinkAChildFromRoot(LinksetRoot, requestor); + // Rebuild the linkset and all its constraints. + RecomputeLinksetConstraints(); + } + RebuildScheduled = false; + }); } - }); + } } } -- cgit v1.1