aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
diff options
context:
space:
mode:
authorRobert Adams2012-09-07 15:46:14 -0700
committerRobert Adams2012-09-07 16:05:28 -0700
commit126eae71009001c5455e4896cf12317422bbac51 (patch)
tree7ceb0c01d5fb352707de447227a308bfe8715c39 /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
parentBulletSim: Add some comments (gasp) and log messages. (diff)
downloadopensim-SC_OLD-126eae71009001c5455e4896cf12317422bbac51.zip
opensim-SC_OLD-126eae71009001c5455e4896cf12317422bbac51.tar.gz
opensim-SC_OLD-126eae71009001c5455e4896cf12317422bbac51.tar.bz2
opensim-SC_OLD-126eae71009001c5455e4896cf12317422bbac51.tar.xz
BulletSim: Add Bullet body and shape to BSPhysObject and rename
'Body' to 'BSBody' for disambiguation when reading code. Complete the API2 interface so nearly all methods on bullet classes are available to the managed code. The efficient single call simulation step is kept in place while all other creation/destruction/parameterization can be done in the managed code.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index dc2b595..fa22c78 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -73,7 +73,8 @@ public class BSCharacter : BSPhysObject
73 private bool _kinematic; 73 private bool _kinematic;
74 private float _buoyancy; 74 private float _buoyancy;
75 75
76 public override BulletBody Body { get; set; } 76 public override BulletBody BSBody { get; set; }
77 public override BulletShape BSShape { get; set; }
77 public override BSLinkset Linkset { get; set; } 78 public override BSLinkset Linkset { get; set; }
78 79
79 private int _subscribedEventsMs = 0; 80 private int _subscribedEventsMs = 0;
@@ -129,9 +130,9 @@ public class BSCharacter : BSPhysObject
129 // Set the buoyancy for flying. This will be refactored when all the settings happen in C# 130 // Set the buoyancy for flying. This will be refactored when all the settings happen in C#
130 BulletSimAPI.SetObjectBuoyancy(Scene.WorldID, LocalID, _buoyancy); 131 BulletSimAPI.SetObjectBuoyancy(Scene.WorldID, LocalID, _buoyancy);
131 132
132 Body = new BulletBody(LocalID, BulletSimAPI.GetBodyHandle2(Scene.World.Ptr, LocalID)); 133 BSBody = new BulletBody(LocalID, BulletSimAPI.GetBodyHandle2(Scene.World.Ptr, LocalID));
133 // avatars get all collisions no matter what (makes walking on ground and such work) 134 // avatars get all collisions no matter what (makes walking on ground and such work)
134 BulletSimAPI.AddToCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); 135 BulletSimAPI.AddToCollisionFlags2(BSBody.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
135 }); 136 });
136 137
137 return; 138 return;
@@ -441,7 +442,7 @@ public class BSCharacter : BSPhysObject
441 Scene.TaintedObject("BSCharacter.AddForce", delegate() 442 Scene.TaintedObject("BSCharacter.AddForce", delegate()
442 { 443 {
443 DetailLog("{0},BSCharacter.setAddForce,taint,addedForce={1}", LocalID, _force); 444 DetailLog("{0},BSCharacter.setAddForce,taint,addedForce={1}", LocalID, _force);
444 BulletSimAPI.AddObjectForce2(Body.Ptr, _force); 445 BulletSimAPI.SetObjectForce2(BSBody.Ptr, _force);
445 }); 446 });
446 } 447 }
447 else 448 else
@@ -466,7 +467,7 @@ public class BSCharacter : BSPhysObject
466 467
467 Scene.TaintedObject("BSCharacter.SubscribeEvents", delegate() 468 Scene.TaintedObject("BSCharacter.SubscribeEvents", delegate()
468 { 469 {
469 BulletSimAPI.AddToCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); 470 BulletSimAPI.AddToCollisionFlags2(BSBody.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
470 }); 471 });
471 } 472 }
472 } 473 }