diff options
author | BlueWall | 2012-12-12 16:15:32 -0500 |
---|---|---|
committer | BlueWall | 2012-12-12 16:15:32 -0500 |
commit | c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc (patch) | |
tree | 644d21cbd5b7e86d9ba3316979fd9a85bc028f51 /OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | |
parent | Replace Mono.Addins libraries (diff) | |
parent | BulletSim: do not return the current velocity for targetVelocity. (diff) | |
download | opensim-SC_OLD-c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc.zip opensim-SC_OLD-c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc.tar.gz opensim-SC_OLD-c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc.tar.bz2 opensim-SC_OLD-c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc.tar.xz |
Merge branch 'master' of /home/opensim/var/repo/opensim
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs index 933f573..4ab9a99 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | |||
@@ -149,7 +149,7 @@ public sealed class BSShapeCollection : IDisposable | |||
149 | // Called when releasing use of a BSBody. BSShape is handled separately. | 149 | // Called when releasing use of a BSBody. BSShape is handled separately. |
150 | public void DereferenceBody(BulletBody body, bool inTaintTime, BodyDestructionCallback bodyCallback ) | 150 | public void DereferenceBody(BulletBody body, bool inTaintTime, BodyDestructionCallback bodyCallback ) |
151 | { | 151 | { |
152 | if (body.ptr == IntPtr.Zero) | 152 | if (!body.HasPhysicalBody) |
153 | return; | 153 | return; |
154 | 154 | ||
155 | lock (m_collectionActivityLock) | 155 | lock (m_collectionActivityLock) |
@@ -243,12 +243,12 @@ public sealed class BSShapeCollection : IDisposable | |||
243 | // Release the usage of a shape. | 243 | // Release the usage of a shape. |
244 | public void DereferenceShape(BulletShape shape, bool inTaintTime, ShapeDestructionCallback shapeCallback) | 244 | public void DereferenceShape(BulletShape shape, bool inTaintTime, ShapeDestructionCallback shapeCallback) |
245 | { | 245 | { |
246 | if (shape.ptr == IntPtr.Zero) | 246 | if (!shape.HasPhysicalShape) |
247 | return; | 247 | return; |
248 | 248 | ||
249 | PhysicsScene.TaintedObject(inTaintTime, "BSShapeCollection.DereferenceShape", delegate() | 249 | PhysicsScene.TaintedObject(inTaintTime, "BSShapeCollection.DereferenceShape", delegate() |
250 | { | 250 | { |
251 | if (shape.ptr != IntPtr.Zero) | 251 | if (shape.HasPhysicalShape) |
252 | { | 252 | { |
253 | if (shape.isNativeShape) | 253 | if (shape.isNativeShape) |
254 | { | 254 | { |
@@ -440,7 +440,7 @@ public sealed class BSShapeCollection : IDisposable | |||
440 | } | 440 | } |
441 | 441 | ||
442 | // Create a mesh/hull shape or a native shape if 'nativeShapePossible' is 'true'. | 442 | // Create a mesh/hull shape or a native shape if 'nativeShapePossible' is 'true'. |
443 | private bool CreateGeomNonSpecial(bool forceRebuild, BSPhysObject prim, ShapeDestructionCallback shapeCallback) | 443 | public bool CreateGeomNonSpecial(bool forceRebuild, BSPhysObject prim, ShapeDestructionCallback shapeCallback) |
444 | { | 444 | { |
445 | bool ret = false; | 445 | bool ret = false; |
446 | bool haveShape = false; | 446 | bool haveShape = false; |
@@ -573,7 +573,7 @@ public sealed class BSShapeCollection : IDisposable | |||
573 | // Native shapes are scaled in Bullet so set the scaling to the size | 573 | // Native shapes are scaled in Bullet so set the scaling to the size |
574 | newShape = new BulletShape(BulletSimAPI.BuildNativeShape2(PhysicsScene.World.ptr, nativeShapeData), shapeType); | 574 | newShape = new BulletShape(BulletSimAPI.BuildNativeShape2(PhysicsScene.World.ptr, nativeShapeData), shapeType); |
575 | } | 575 | } |
576 | if (newShape.ptr == IntPtr.Zero) | 576 | if (!newShape.HasPhysicalShape) |
577 | { | 577 | { |
578 | PhysicsScene.Logger.ErrorFormat("{0} BuildPhysicalNativeShape failed. ID={1}, shape={2}", | 578 | PhysicsScene.Logger.ErrorFormat("{0} BuildPhysicalNativeShape failed. ID={1}, shape={2}", |
579 | LogHeader, prim.LocalID, shapeType); | 579 | LogHeader, prim.LocalID, shapeType); |
@@ -590,7 +590,7 @@ public sealed class BSShapeCollection : IDisposable | |||
590 | // Called at taint-time! | 590 | // Called at taint-time! |
591 | private bool GetReferenceToMesh(BSPhysObject prim, ShapeDestructionCallback shapeCallback) | 591 | private bool GetReferenceToMesh(BSPhysObject prim, ShapeDestructionCallback shapeCallback) |
592 | { | 592 | { |
593 | BulletShape newShape = new BulletShape(IntPtr.Zero); | 593 | BulletShape newShape = new BulletShape(); |
594 | 594 | ||
595 | float lod; | 595 | float lod; |
596 | System.UInt64 newMeshKey = ComputeShapeKey(prim.Size, prim.BaseShape, out lod); | 596 | System.UInt64 newMeshKey = ComputeShapeKey(prim.Size, prim.BaseShape, out lod); |
@@ -793,7 +793,7 @@ public sealed class BSShapeCollection : IDisposable | |||
793 | BulletShape newShape = new BulletShape(hullPtr, BSPhysicsShapeType.SHAPE_HULL); | 793 | BulletShape newShape = new BulletShape(hullPtr, BSPhysicsShapeType.SHAPE_HULL); |
794 | newShape.shapeKey = newHullKey; | 794 | newShape.shapeKey = newHullKey; |
795 | 795 | ||
796 | return newShape; // 'true' means a new shape has been added to this prim | 796 | return newShape; |
797 | } | 797 | } |
798 | 798 | ||
799 | // Callback from convex hull creater with a newly created hull. | 799 | // Callback from convex hull creater with a newly created hull. |
@@ -860,7 +860,7 @@ public sealed class BSShapeCollection : IDisposable | |||
860 | private BulletShape VerifyMeshCreated(BulletShape newShape, BSPhysObject prim) | 860 | private BulletShape VerifyMeshCreated(BulletShape newShape, BSPhysObject prim) |
861 | { | 861 | { |
862 | // If the shape was successfully created, nothing more to do | 862 | // If the shape was successfully created, nothing more to do |
863 | if (newShape.ptr != IntPtr.Zero) | 863 | if (newShape.HasPhysicalShape) |
864 | return newShape; | 864 | return newShape; |
865 | 865 | ||
866 | // If this mesh has an underlying asset and we have not failed getting it before, fetch the asset | 866 | // If this mesh has an underlying asset and we have not failed getting it before, fetch the asset |
@@ -919,7 +919,7 @@ public sealed class BSShapeCollection : IDisposable | |||
919 | bool ret = false; | 919 | bool ret = false; |
920 | 920 | ||
921 | // the mesh, hull or native shape must have already been created in Bullet | 921 | // the mesh, hull or native shape must have already been created in Bullet |
922 | bool mustRebuild = (prim.PhysBody.ptr == IntPtr.Zero); | 922 | bool mustRebuild = !prim.PhysBody.HasPhysicalBody; |
923 | 923 | ||
924 | // If there is an existing body, verify it's of an acceptable type. | 924 | // If there is an existing body, verify it's of an acceptable type. |
925 | // If not a solid object, body is a GhostObject. Otherwise a RigidBody. | 925 | // If not a solid object, body is a GhostObject. Otherwise a RigidBody. |