From 75a05c16c5c0ec0712f7f564b60530e0a3fd1c82 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 31 Jan 2013 15:52:50 -0800 Subject: BulletSim: fix crash caused when linksets were rebuilt. A problem added when individual child pos/rot changes were implementated a week or so ago. Remove some passing of inTaintTime flag when it was never false. --- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 0b81122..54bf063 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -146,9 +146,9 @@ public sealed class BSPrim : BSPhysObject { DetailLog("{0},BSPrim.Destroy,taint,", LocalID); // If there are physical body and shape, release my use of same. - PhysicsScene.Shapes.DereferenceBody(PhysBody, true, null); + PhysicsScene.Shapes.DereferenceBody(PhysBody, null); PhysBody.Clear(); - PhysicsScene.Shapes.DereferenceShape(PhysShape, true, null); + PhysicsScene.Shapes.DereferenceShape(PhysShape, null); PhysShape.Clear(); }); } @@ -181,11 +181,19 @@ public sealed class BSPrim : BSPhysObject public override bool ForceBodyShapeRebuild(bool inTaintTime) { - PhysicsScene.TaintedObject(inTaintTime, "BSPrim.ForceBodyShapeRebuild", delegate() + if (inTaintTime) { _mass = CalculateMass(); // changing the shape changes the mass CreateGeomAndObject(true); - }); + } + else + { + PhysicsScene.TaintedObject("BSPrim.ForceBodyShapeRebuild", delegate() + { + _mass = CalculateMass(); // changing the shape changes the mass + CreateGeomAndObject(true); + }); + } return true; } public override bool Grabbed { -- cgit v1.1