aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
authorRobert Adams2012-08-31 13:32:22 -0700
committerRobert Adams2012-09-07 16:05:11 -0700
commit76dc29dc379036aa44f1ef78782f7ac94760a80f (patch)
treea9007f98060ae4ee6dbd9d10cebfc56578c2b437 /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
parentrenaming to markdown file (diff)
downloadopensim-SC-76dc29dc379036aa44f1ef78782f7ac94760a80f.zip
opensim-SC-76dc29dc379036aa44f1ef78782f7ac94760a80f.tar.gz
opensim-SC-76dc29dc379036aa44f1ef78782f7ac94760a80f.tar.bz2
opensim-SC-76dc29dc379036aa44f1ef78782f7ac94760a80f.tar.xz
BulletSim: Modify collision flag calls to return the current flags.
Track current collision flags in BSPrim. Add BulletSimAPI calls for saving and restoring rigidBodies using construction information structure.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 6bfce5c..6fcd416 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -94,6 +94,7 @@ public sealed class BSPrim : BSPhysObject
94 private int _nextCollisionOkTime = 0; 94 private int _nextCollisionOkTime = 0;
95 long _collidingStep; 95 long _collidingStep;
96 long _collidingGroundStep; 96 long _collidingGroundStep;
97 CollisionFlags m_currentCollisionFlags = 0;
97 98
98 public override BulletBody Body { get; set; } 99 public override BulletBody Body { get; set; }
99 100
@@ -143,6 +144,7 @@ public sealed class BSPrim : BSPhysObject
143 // At the moment, we're still letting BulletSim manage the creation and destruction 144 // At the moment, we're still letting BulletSim manage the creation and destruction
144 // of the object. Someday we'll move that into the C# code. 145 // of the object. Someday we'll move that into the C# code.
145 Body = new BulletBody(LocalID, BulletSimAPI.GetBodyHandle2(_scene.World.Ptr, LocalID)); 146 Body = new BulletBody(LocalID, BulletSimAPI.GetBodyHandle2(_scene.World.Ptr, LocalID));
147 m_currentCollisionFlags = BulletSimAPI.GetCollisionFlags2(Body.Ptr);
146 }); 148 });
147 } 149 }
148 150
@@ -483,8 +485,7 @@ public sealed class BSPrim : BSPhysObject
483 // recompute any linkset parameters 485 // recompute any linkset parameters
484 Linkset.Refresh(this); 486 Linkset.Refresh(this);
485 487
486 CollisionFlags cf = BulletSimAPI.GetCollisionFlags2(Body.Ptr); 488 DetailLog("{0},BSPrim.SetObjectDynamic,taint,static={1},solid={2},mass={3}, cf={4}", LocalID, IsStatic, IsSolid, mass, m_currentCollisionFlags);
487 DetailLog("{0},BSPrim.SetObjectDynamic,taint,static={1},solid={2},mass={3}, cf={4}", LocalID, IsStatic, IsSolid, mass, cf);
488 } 489 }
489 490
490 // prims don't fly 491 // prims don't fly
@@ -644,7 +645,7 @@ public sealed class BSPrim : BSPhysObject
644 645
645 Scene.TaintedObject("BSPrim.SubscribeEvents", delegate() 646 Scene.TaintedObject("BSPrim.SubscribeEvents", delegate()
646 { 647 {
647 BulletSimAPI.AddToCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); 648 m_currentCollisionFlags = BulletSimAPI.AddToCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
648 }); 649 });
649 } 650 }
650 } 651 }
@@ -652,7 +653,7 @@ public sealed class BSPrim : BSPhysObject
652 _subscribedEventsMs = 0; 653 _subscribedEventsMs = 0;
653 Scene.TaintedObject("BSPrim.UnSubscribeEvents", delegate() 654 Scene.TaintedObject("BSPrim.UnSubscribeEvents", delegate()
654 { 655 {
655 BulletSimAPI.RemoveFromCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); 656 m_currentCollisionFlags = BulletSimAPI.RemoveFromCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
656 }); 657 });
657 } 658 }
658 public override bool SubscribedEvents() { 659 public override bool SubscribedEvents() {