aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
index b1833c5..30fa50a 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
@@ -338,6 +338,7 @@ public class BSShapeCollection : IDisposable
338 ret = GetReferenceToNativeShape(prim, shapeData, ShapeData.PhysicsShapeType.SHAPE_AVATAR, 338 ret = GetReferenceToNativeShape(prim, shapeData, ShapeData.PhysicsShapeType.SHAPE_AVATAR,
339 ShapeData.FixedShapeKey.KEY_CAPSULE, shapeCallback); 339 ShapeData.FixedShapeKey.KEY_CAPSULE, shapeCallback);
340 DetailLog("{0},BSShapeCollection.CreateGeom,avatarCapsule,shape={1}", prim.LocalID, prim.BSShape); 340 DetailLog("{0},BSShapeCollection.CreateGeom,avatarCapsule,shape={1}", prim.LocalID, prim.BSShape);
341 ret = true;
341 haveShape = true; 342 haveShape = true;
342 } 343 }
343 // If the prim attributes are simple, this could be a simple Bullet native shape 344 // If the prim attributes are simple, this could be a simple Bullet native shape
@@ -411,15 +412,14 @@ public class BSShapeCollection : IDisposable
411 ShapeData.PhysicsShapeType shapeType, ShapeData.FixedShapeKey shapeKey, 412 ShapeData.PhysicsShapeType shapeType, ShapeData.FixedShapeKey shapeKey,
412 ShapeDestructionCallback shapeCallback) 413 ShapeDestructionCallback shapeCallback)
413 { 414 {
415 // release any previous shape
416 DereferenceShape(prim.BSShape, true, shapeCallback);
414 417
415 shapeData.Type = shapeType; 418 shapeData.Type = shapeType;
416 // Bullet native objects are scaled by the Bullet engine so pass the size in 419 // Bullet native objects are scaled by the Bullet engine so pass the size in
417 prim.Scale = shapeData.Size; 420 prim.Scale = shapeData.Size;
418 shapeData.Scale = shapeData.Size; 421 shapeData.Scale = shapeData.Size;
419 422
420 // release any previous shape
421 DereferenceShape(prim.BSShape, true, shapeCallback);
422
423 BulletShape newShape = BuildPhysicalNativeShape(shapeType, shapeData, shapeKey); 423 BulletShape newShape = BuildPhysicalNativeShape(shapeType, shapeData, shapeKey);
424 424
425 // Don't need to do a 'ReferenceShape()' here because native shapes are not shared. 425 // Don't need to do a 'ReferenceShape()' here because native shapes are not shared.
@@ -443,7 +443,8 @@ public class BSShapeCollection : IDisposable
443 if (shapeType == ShapeData.PhysicsShapeType.SHAPE_AVATAR) 443 if (shapeType == ShapeData.PhysicsShapeType.SHAPE_AVATAR)
444 { 444 {
445 newShape = new BulletShape( 445 newShape = new BulletShape(
446 BulletSimAPI.BuildCapsuleShape2(PhysicsScene.World.ptr, 1.0f, 1.0f, nativeShapeData.Scale), shapeType); 446 BulletSimAPI.BuildCapsuleShape2(PhysicsScene.World.ptr, 1f, 1f, nativeShapeData.Scale)
447 , shapeType);
447 DetailLog("{0},BSShapeCollection.BuiletPhysicalNativeShape,capsule,scale={1}", nativeShapeData.ID, nativeShapeData.Scale); 448 DetailLog("{0},BSShapeCollection.BuiletPhysicalNativeShape,capsule,scale={1}", nativeShapeData.ID, nativeShapeData.Scale);
448 } 449 }
449 else 450 else
@@ -790,7 +791,6 @@ public class BSShapeCollection : IDisposable
790 // If the collisionObject is not the correct type for solidness, rebuild what's there 791 // If the collisionObject is not the correct type for solidness, rebuild what's there
791 mustRebuild = true; 792 mustRebuild = true;
792 } 793 }
793
794 } 794 }
795 795
796 if (mustRebuild || forceRebuild) 796 if (mustRebuild || forceRebuild)