aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
diff options
context:
space:
mode:
authorRobert Adams2012-11-01 10:53:55 -0700
committerRobert Adams2012-11-03 21:15:22 -0700
commitf53b4e7a21f62a84e237c4ce8d2806124c3a76d2 (patch)
tree1a815eafa4cec6e930b527fe81985b37f25f006a /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
parentBulletSim: Remove use of shapeData in ShapeCollection and rely on the availab... (diff)
downloadopensim-SC_OLD-f53b4e7a21f62a84e237c4ce8d2806124c3a76d2.zip
opensim-SC_OLD-f53b4e7a21f62a84e237c4ce8d2806124c3a76d2.tar.gz
opensim-SC_OLD-f53b4e7a21f62a84e237c4ce8d2806124c3a76d2.tar.bz2
opensim-SC_OLD-f53b4e7a21f62a84e237c4ce8d2806124c3a76d2.tar.xz
BulletSim: Add RawPosition and RawOrientation to BSPhysObject and rename MassRaw to RawMass. Fix BSShapeCollection to use Raw* for creating the body to eliminate exception from referencing the physical body before it has been created.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs20
1 files changed, 15 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 2a634b9..9e1206a 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -97,7 +97,7 @@ public sealed class BSCharacter : BSPhysObject
97 // set _avatarVolume and _mass based on capsule size, _density and Scale 97 // set _avatarVolume and _mass based on capsule size, _density and Scale
98 ComputeAvatarVolumeAndMass(); 98 ComputeAvatarVolumeAndMass();
99 DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5}", 99 DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5}",
100 LocalID, _size, Scale, _avatarDensity, _avatarVolume, MassRaw); 100 LocalID, _size, Scale, _avatarDensity, _avatarVolume, RawMass);
101 101
102 // do actual create at taint time 102 // do actual create at taint time
103 PhysicsScene.TaintedObject("BSCharacter.create", delegate() 103 PhysicsScene.TaintedObject("BSCharacter.create", delegate()
@@ -141,7 +141,7 @@ public sealed class BSCharacter : BSPhysObject
141 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, PhysicsScene.Params.ccdSweptSphereRadius); 141 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, PhysicsScene.Params.ccdSweptSphereRadius);
142 } 142 }
143 143
144 UpdatePhysicalMassProperties(MassRaw); 144 UpdatePhysicalMassProperties(RawMass);
145 145
146 // Make so capsule does not fall over 146 // Make so capsule does not fall over
147 BulletSimAPI.SetAngularFactorV2(PhysBody.ptr, OMV.Vector3.Zero); 147 BulletSimAPI.SetAngularFactorV2(PhysBody.ptr, OMV.Vector3.Zero);
@@ -181,12 +181,12 @@ public sealed class BSCharacter : BSPhysObject
181 ComputeAvatarScale(_size); 181 ComputeAvatarScale(_size);
182 ComputeAvatarVolumeAndMass(); 182 ComputeAvatarVolumeAndMass();
183 DetailLog("{0},BSCharacter.setSize,call,scale={1},density={2},volume={3},mass={4}", 183 DetailLog("{0},BSCharacter.setSize,call,scale={1},density={2},volume={3},mass={4}",
184 LocalID, Scale, _avatarDensity, _avatarVolume, MassRaw); 184 LocalID, Scale, _avatarDensity, _avatarVolume, RawMass);
185 185
186 PhysicsScene.TaintedObject("BSCharacter.setSize", delegate() 186 PhysicsScene.TaintedObject("BSCharacter.setSize", delegate()
187 { 187 {
188 BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale); 188 BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale);
189 UpdatePhysicalMassProperties(MassRaw); 189 UpdatePhysicalMassProperties(RawMass);
190 }); 190 });
191 191
192 } 192 }
@@ -231,6 +231,11 @@ public sealed class BSCharacter : BSPhysObject
231 231
232 public override void LockAngularMotion(OMV.Vector3 axis) { return; } 232 public override void LockAngularMotion(OMV.Vector3 axis) { return; }
233 233
234 public override OMV.Vector3 RawPosition
235 {
236 get { return _position; }
237 set { _position = value; }
238 }
234 public override OMV.Vector3 Position { 239 public override OMV.Vector3 Position {
235 get { 240 get {
236 // _position = BulletSimAPI.GetObjectPosition2(Scene.World.ptr, LocalID); 241 // _position = BulletSimAPI.GetObjectPosition2(Scene.World.ptr, LocalID);
@@ -316,7 +321,7 @@ public sealed class BSCharacter : BSPhysObject
316 public override float Mass { get { return _mass; } } 321 public override float Mass { get { return _mass; } }
317 322
318 // used when we only want this prim's mass and not the linkset thing 323 // used when we only want this prim's mass and not the linkset thing
319 public override float MassRaw { 324 public override float RawMass {
320 get {return _mass; } 325 get {return _mass; }
321 } 326 }
322 public override void UpdatePhysicalMassProperties(float physMass) 327 public override void UpdatePhysicalMassProperties(float physMass)
@@ -405,6 +410,11 @@ public sealed class BSCharacter : BSPhysObject
405 get { return _acceleration; } 410 get { return _acceleration; }
406 set { _acceleration = value; } 411 set { _acceleration = value; }
407 } 412 }
413 public override OMV.Quaternion RawOrientation
414 {
415 get { return _orientation; }
416 set { _orientation = value; }
417 }
408 public override OMV.Quaternion Orientation { 418 public override OMV.Quaternion Orientation {
409 get { return _orientation; } 419 get { return _orientation; }
410 set { 420 set {