aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorRobert Adams2012-10-02 10:56:39 -0700
committerRobert Adams2012-10-02 11:14:03 -0700
commitd8a786870b5ff03241e9f6b0393a2e1f91de2b01 (patch)
tree7b4894b1ec71e945f37ed1cd6b2787a9ba58bee8 /OpenSim
parentBulletSim: Fix linkset problem where delayed manipulations of child objects w... (diff)
downloadopensim-SC_OLD-d8a786870b5ff03241e9f6b0393a2e1f91de2b01.zip
opensim-SC_OLD-d8a786870b5ff03241e9f6b0393a2e1f91de2b01.tar.gz
opensim-SC_OLD-d8a786870b5ff03241e9f6b0393a2e1f91de2b01.tar.bz2
opensim-SC_OLD-d8a786870b5ff03241e9f6b0393a2e1f91de2b01.tar.xz
BulletSim: Fix problem where box shapes were not being rebuilt if the shape type changed.
Diffstat (limited to 'OpenSim')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
index a86bf8a..399a133 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
@@ -108,7 +108,8 @@ public class BSShapeCollection : IDisposable
108 // If we had to select a new shape geometry for the object, 108 // If we had to select a new shape geometry for the object,
109 // rebuild the body around it. 109 // rebuild the body around it.
110 // Updates prim.BSBody with information/pointers to requested body 110 // Updates prim.BSBody with information/pointers to requested body
111 bool newBody = CreateBody((newGeom || forceRebuild), prim, PhysicsScene.World, prim.BSShape, shapeData, bodyCallback); 111 bool newBody = CreateBody((newGeom || forceRebuild), prim, PhysicsScene.World,
112 prim.BSShape, shapeData, bodyCallback);
112 ret = newGeom || newBody; 113 ret = newGeom || newBody;
113 } 114 }
114 DetailLog("{0},BSShapeCollection.GetBodyAndShape,force={1},ret={2},body={3},shape={4}", 115 DetailLog("{0},BSShapeCollection.GetBodyAndShape,force={1},ret={2},body={3},shape={4}",
@@ -140,7 +141,7 @@ public class BSShapeCollection : IDisposable
140 bodyDesc.lastReferenced = System.DateTime.Now; 141 bodyDesc.lastReferenced = System.DateTime.Now;
141 Bodies[body.ID] = bodyDesc; 142 Bodies[body.ID] = bodyDesc;
142 } 143 }
143} 144 }
144 145
145 // Release the usage of a body. 146 // Release the usage of a body.
146 // Called when releasing use of a BSBody. BSShape is handled separately. 147 // Called when releasing use of a BSBody. BSShape is handled separately.
@@ -167,7 +168,7 @@ public class BSShapeCollection : IDisposable
167 { 168 {
168 DetailLog("{0},BSShapeCollection.DereferenceBody,DestroyingBody. ptr={1}", 169 DetailLog("{0},BSShapeCollection.DereferenceBody,DestroyingBody. ptr={1}",
169 body.ID, body.ptr.ToString("X")); 170 body.ID, body.ptr.ToString("X"));
170 // If the caller needs to know, pass the event up. 171 // If the caller needs to know the old body is going away, pass the event up.
171 if (bodyCallback != null) bodyCallback(body); 172 if (bodyCallback != null) bodyCallback(body);
172 173
173 // Zero any reference to the shape so it is not freed when the body is deleted. 174 // Zero any reference to the shape so it is not freed when the body is deleted.
@@ -448,7 +449,8 @@ public class BSShapeCollection : IDisposable
448 ulong newMeshKey = ComputeShapeKey(shapeData, pbs, out lod); 449 ulong newMeshKey = ComputeShapeKey(shapeData, pbs, out lod);
449 450
450 // if this new shape is the same as last time, don't recreate the mesh 451 // if this new shape is the same as last time, don't recreate the mesh
451 if (prim.BSShape.shapeKey == newMeshKey) return false; 452 if (newMeshKey == prim.BSShape.shapeKey && prim.BSShape.type == ShapeData.PhysicsShapeType.SHAPE_MESH)
453 return false;
452 454
453 DetailLog("{0},BSShapeCollection.CreateGeomMesh,create,oldKey={1},newKey={2}", 455 DetailLog("{0},BSShapeCollection.CreateGeomMesh,create,oldKey={1},newKey={2}",
454 prim.LocalID, prim.BSShape.shapeKey.ToString("X"), newMeshKey.ToString("X")); 456 prim.LocalID, prim.BSShape.shapeKey.ToString("X"), newMeshKey.ToString("X"));