diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 22f5995..8e6685b 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -642,11 +642,23 @@ public sealed class BSPrim : PhysicsActor | |||
642 | } | 642 | } |
643 | public override void SubscribeEvents(int ms) { | 643 | public override void SubscribeEvents(int ms) { |
644 | _subscribedEventsMs = ms; | 644 | _subscribedEventsMs = ms; |
645 | // make sure first collision happens | 645 | if (ms > 0) |
646 | _nextCollisionOkTime = Util.EnvironmentTickCount() - _subscribedEventsMs; | 646 | { |
647 | // make sure first collision happens | ||
648 | _nextCollisionOkTime = Util.EnvironmentTickCount() - _subscribedEventsMs; | ||
649 | |||
650 | Scene.TaintedObject(delegate() | ||
651 | { | ||
652 | BulletSimAPI.AddToCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | ||
653 | }); | ||
654 | } | ||
647 | } | 655 | } |
648 | public override void UnSubscribeEvents() { | 656 | public override void UnSubscribeEvents() { |
649 | _subscribedEventsMs = 0; | 657 | _subscribedEventsMs = 0; |
658 | Scene.TaintedObject(delegate() | ||
659 | { | ||
660 | BulletSimAPI.RemoveFromCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | ||
661 | }); | ||
650 | } | 662 | } |
651 | public override bool SubscribedEvents() { | 663 | public override bool SubscribedEvents() { |
652 | return (_subscribedEventsMs > 0); | 664 | return (_subscribedEventsMs > 0); |