diff options
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs index a53ad6e..869735c 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | |||
@@ -525,9 +525,6 @@ public sealed class BSShapeCollection : IDisposable | |||
525 | // release any previous shape | 525 | // release any previous shape |
526 | DereferenceShape(prim.PhysShape, true, shapeCallback); | 526 | DereferenceShape(prim.PhysShape, true, shapeCallback); |
527 | 527 | ||
528 | // Bullet native objects are scaled by the Bullet engine so pass the size in | ||
529 | prim.Scale = prim.Size; | ||
530 | |||
531 | BulletShape newShape = BuildPhysicalNativeShape(prim, shapeType, shapeKey); | 528 | BulletShape newShape = BuildPhysicalNativeShape(prim, shapeType, shapeKey); |
532 | 529 | ||
533 | // Don't need to do a 'ReferenceShape()' here because native shapes are not shared. | 530 | // Don't need to do a 'ReferenceShape()' here because native shapes are not shared. |
@@ -547,12 +544,13 @@ public sealed class BSShapeCollection : IDisposable | |||
547 | nativeShapeData.Type = shapeType; | 544 | nativeShapeData.Type = shapeType; |
548 | nativeShapeData.ID = prim.LocalID; | 545 | nativeShapeData.ID = prim.LocalID; |
549 | nativeShapeData.Scale = prim.Scale; | 546 | nativeShapeData.Scale = prim.Scale; |
550 | nativeShapeData.Size = prim.Scale; | 547 | nativeShapeData.Size = prim.Scale; // unneeded, I think. |
551 | nativeShapeData.MeshKey = (ulong)shapeKey; | 548 | nativeShapeData.MeshKey = (ulong)shapeKey; |
552 | nativeShapeData.HullKey = (ulong)shapeKey; | 549 | nativeShapeData.HullKey = (ulong)shapeKey; |
553 | 550 | ||
554 | if (shapeType == PhysicsShapeType.SHAPE_CAPSULE) | 551 | if (shapeType == PhysicsShapeType.SHAPE_CAPSULE) |
555 | { | 552 | { |
553 | // The proper scale has been calculated in the prim. | ||
556 | newShape = new BulletShape( | 554 | newShape = new BulletShape( |
557 | BulletSimAPI.BuildCapsuleShape2(PhysicsScene.World.ptr, 1f, 1f, prim.Scale) | 555 | BulletSimAPI.BuildCapsuleShape2(PhysicsScene.World.ptr, 1f, 1f, prim.Scale) |
558 | , shapeType); | 556 | , shapeType); |
@@ -560,6 +558,9 @@ public sealed class BSShapeCollection : IDisposable | |||
560 | } | 558 | } |
561 | else | 559 | else |
562 | { | 560 | { |
561 | // Native shapes are scaled in Bullet so set the scaling to the size | ||
562 | prim.Scale = prim.Size; | ||
563 | nativeShapeData.Scale = prim.Scale; | ||
563 | newShape = new BulletShape(BulletSimAPI.BuildNativeShape2(PhysicsScene.World.ptr, nativeShapeData), shapeType); | 564 | newShape = new BulletShape(BulletSimAPI.BuildNativeShape2(PhysicsScene.World.ptr, nativeShapeData), shapeType); |
564 | } | 565 | } |
565 | if (newShape.ptr == IntPtr.Zero) | 566 | if (newShape.ptr == IntPtr.Zero) |