aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs20
1 files changed, 14 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index b5dd131..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
146 { 146 {
147 DetailLog("{0},BSPrim.Destroy,taint,", LocalID); 147 DetailLog("{0},BSPrim.Destroy,taint,", LocalID);
148 // If there are physical body and shape, release my use of same. 148 // If there are physical body and shape, release my use of same.
149 PhysicsScene.Shapes.DereferenceBody(PhysBody, true, null); 149 PhysicsScene.Shapes.DereferenceBody(PhysBody, null);
150 PhysBody.Clear(); 150 PhysBody.Clear();
151 PhysicsScene.Shapes.DereferenceShape(PhysShape, true, null); 151 PhysicsScene.Shapes.DereferenceShape(PhysShape, null);
152 PhysShape.Clear(); 152 PhysShape.Clear();
153 }); 153 });
154 } 154 }
@@ -181,11 +181,19 @@ public sealed class BSPrim : BSPhysObject
181 181
182 public override bool ForceBodyShapeRebuild(bool inTaintTime) 182 public override bool ForceBodyShapeRebuild(bool inTaintTime)
183 { 183 {
184 PhysicsScene.TaintedObject(inTaintTime, "BSPrim.ForceBodyShapeRebuild", delegate() 184 if (inTaintTime)
185 { 185 {
186 _mass = CalculateMass(); // changing the shape changes the mass 186 _mass = CalculateMass(); // changing the shape changes the mass
187 CreateGeomAndObject(true); 187 CreateGeomAndObject(true);
188 }); 188 }
189 else
190 {
191 PhysicsScene.TaintedObject("BSPrim.ForceBodyShapeRebuild", delegate()
192 {
193 _mass = CalculateMass(); // changing the shape changes the mass
194 CreateGeomAndObject(true);
195 });
196 }
189 return true; 197 return true;
190 } 198 }
191 public override bool Grabbed { 199 public override bool Grabbed {
@@ -1597,9 +1605,9 @@ public sealed class BSPrim : BSPhysObject
1597 public void CreateGeomAndObject(bool forceRebuild) 1605 public void CreateGeomAndObject(bool forceRebuild)
1598 { 1606 {
1599 // Create the correct physical representation for this type of object. 1607 // Create the correct physical representation for this type of object.
1600 // Updates PhysBody and PhysShape with the new information. 1608 // Updates base.PhysBody and base.PhysShape with the new information.
1601 // Ignore 'forceRebuild'. This routine makes the right choices and changes of necessary. 1609 // Ignore 'forceRebuild'. This routine makes the right choices and changes of necessary.
1602 PhysicsScene.Shapes.GetBodyAndShape(false, PhysicsScene.World, this, null, delegate(BulletBody dBody) 1610 PhysicsScene.Shapes.GetBodyAndShape(false /*forceRebuild */, PhysicsScene.World, this, null, delegate(BulletBody dBody)
1603 { 1611 {
1604 // Called if the current prim body is about to be destroyed. 1612 // Called if the current prim body is about to be destroyed.
1605 // Remove all the physical dependencies on the old body. 1613 // Remove all the physical dependencies on the old body.