diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 9dc52d5..f89b376 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -121,7 +121,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
121 | public virtual void Destroy() | 121 | public virtual void Destroy() |
122 | { | 122 | { |
123 | PhysicalActors.Enable(false); | 123 | PhysicalActors.Enable(false); |
124 | PhysScene.TaintedObject("BSPhysObject.Destroy", delegate() | 124 | PhysScene.TaintedObject(LocalID, "BSPhysObject.Destroy", delegate() |
125 | { | 125 | { |
126 | PhysicalActors.Dispose(); | 126 | PhysicalActors.Dispose(); |
127 | }); | 127 | }); |
@@ -300,8 +300,19 @@ public abstract class BSPhysObject : PhysicsActor | |||
300 | // Called in taint-time!! | 300 | // Called in taint-time!! |
301 | public void ActivateIfPhysical(bool forceIt) | 301 | public void ActivateIfPhysical(bool forceIt) |
302 | { | 302 | { |
303 | if (IsPhysical && PhysBody.HasPhysicalBody) | 303 | if (PhysBody.HasPhysicalBody) |
304 | PhysScene.PE.Activate(PhysBody, forceIt); | 304 | { |
305 | if (IsPhysical) | ||
306 | { | ||
307 | // Physical objects might need activating | ||
308 | PhysScene.PE.Activate(PhysBody, forceIt); | ||
309 | } | ||
310 | else | ||
311 | { | ||
312 | // Clear the collision cache since we've changed some properties. | ||
313 | PhysScene.PE.ClearCollisionProxyCache(PhysScene.World, PhysBody); | ||
314 | } | ||
315 | } | ||
305 | } | 316 | } |
306 | 317 | ||
307 | // 'actors' act on the physical object to change or constrain its motion. These can range from | 318 | // 'actors' act on the physical object to change or constrain its motion. These can range from |
@@ -509,7 +520,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
509 | // make sure first collision happens | 520 | // make sure first collision happens |
510 | NextCollisionOkTime = Util.EnvironmentTickCountSubtract(SubscribedEventsMs); | 521 | NextCollisionOkTime = Util.EnvironmentTickCountSubtract(SubscribedEventsMs); |
511 | 522 | ||
512 | PhysScene.TaintedObject(TypeName+".SubscribeEvents", delegate() | 523 | PhysScene.TaintedObject(LocalID, TypeName+".SubscribeEvents", delegate() |
513 | { | 524 | { |
514 | if (PhysBody.HasPhysicalBody) | 525 | if (PhysBody.HasPhysicalBody) |
515 | CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | 526 | CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); |
@@ -524,7 +535,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
524 | public override void UnSubscribeEvents() { | 535 | public override void UnSubscribeEvents() { |
525 | // DetailLog("{0},{1}.UnSubscribeEvents,unsubscribing", LocalID, TypeName); | 536 | // DetailLog("{0},{1}.UnSubscribeEvents,unsubscribing", LocalID, TypeName); |
526 | SubscribedEventsMs = 0; | 537 | SubscribedEventsMs = 0; |
527 | PhysScene.TaintedObject(TypeName+".UnSubscribeEvents", delegate() | 538 | PhysScene.TaintedObject(LocalID, TypeName+".UnSubscribeEvents", delegate() |
528 | { | 539 | { |
529 | // Make sure there is a body there because sometimes destruction happens in an un-ideal order. | 540 | // Make sure there is a body there because sometimes destruction happens in an un-ideal order. |
530 | if (PhysBody.HasPhysicalBody) | 541 | if (PhysBody.HasPhysicalBody) |