aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
authorRobert Adams2012-08-03 14:44:07 -0700
committerRobert Adams2012-08-03 15:09:56 -0700
commite7ad6ed3a3fda013cd393df6bb50236871092249 (patch)
treedd8b6b28ae7226c28a8b3a07a893ea24ecb24fb8 /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
parentBulletSim: Add AddObjectForce to BulletSim API. (diff)
downloadopensim-SC_OLD-e7ad6ed3a3fda013cd393df6bb50236871092249.zip
opensim-SC_OLD-e7ad6ed3a3fda013cd393df6bb50236871092249.tar.gz
opensim-SC_OLD-e7ad6ed3a3fda013cd393df6bb50236871092249.tar.bz2
opensim-SC_OLD-e7ad6ed3a3fda013cd393df6bb50236871092249.tar.xz
BulletSim: pass collision subscription information to the C++ code so collisions on objects that don't care are not reported up.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs16
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);