aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSNPlugin/BSCharacter.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/BulletSNPlugin/BSCharacter.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSNPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSNPlugin/BSCharacter.cs
index 4c4e950..d91c47f 100644
--- a/OpenSim/Region/Physics/BulletSNPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSNPlugin/BSCharacter.cs
@@ -174,7 +174,7 @@ public sealed class BSCharacter : BSPhysObject
174 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, BSParam.CcdSweptSphereRadius); 174 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, BSParam.CcdSweptSphereRadius);
175 } 175 }
176 176
177 UpdatePhysicalMassProperties(RawMass); 177 UpdatePhysicalMassProperties(RawMass, false);
178 178
179 // Make so capsule does not fall over 179 // Make so capsule does not fall over
180 BulletSimAPI.SetAngularFactorV2(PhysBody.ptr, OMV.Vector3.Zero); 180 BulletSimAPI.SetAngularFactorV2(PhysBody.ptr, OMV.Vector3.Zero);
@@ -224,7 +224,7 @@ public sealed class BSCharacter : BSPhysObject
224 if (PhysBody.HasPhysicalBody && PhysShape.HasPhysicalShape) 224 if (PhysBody.HasPhysicalBody && PhysShape.HasPhysicalShape)
225 { 225 {
226 BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale); 226 BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale);
227 UpdatePhysicalMassProperties(RawMass); 227 UpdatePhysicalMassProperties(RawMass, true);
228 // Make sure this change appears as a property update event 228 // Make sure this change appears as a property update event
229 BulletSimAPI.PushUpdate2(PhysBody.ptr); 229 BulletSimAPI.PushUpdate2(PhysBody.ptr);
230 } 230 }
@@ -260,7 +260,6 @@ public sealed class BSCharacter : BSPhysObject
260 public override void ZeroMotion(bool inTaintTime) 260 public override void ZeroMotion(bool inTaintTime)
261 { 261 {
262 _velocity = OMV.Vector3.Zero; 262 _velocity = OMV.Vector3.Zero;
263 _velocityMotor.Zero();
264 _acceleration = OMV.Vector3.Zero; 263 _acceleration = OMV.Vector3.Zero;
265 _rotationalVelocity = OMV.Vector3.Zero; 264 _rotationalVelocity = OMV.Vector3.Zero;
266 265
@@ -390,7 +389,7 @@ public sealed class BSCharacter : BSPhysObject
390 public override float RawMass { 389 public override float RawMass {
391 get {return _mass; } 390 get {return _mass; }
392 } 391 }
393 public override void UpdatePhysicalMassProperties(float physMass) 392 public override void UpdatePhysicalMassProperties(float physMass, bool inWorld)
394 { 393 {
395 OMV.Vector3 localInertia = BulletSimAPI.CalculateLocalInertia2(PhysShape.ptr, physMass); 394 OMV.Vector3 localInertia = BulletSimAPI.CalculateLocalInertia2(PhysShape.ptr, physMass);
396 BulletSimAPI.SetMassProps2(PhysBody.ptr, physMass, localInertia); 395 BulletSimAPI.SetMassProps2(PhysBody.ptr, physMass, localInertia);
@@ -787,6 +786,7 @@ public sealed class BSCharacter : BSPhysObject
787 // the motor can be turned off. Set the velocity to zero so the zero motion is sent to the viewer. 786 // the motor can be turned off. Set the velocity to zero so the zero motion is sent to the viewer.
788 if (_velocityMotor.TargetValue.ApproxEquals(OMV.Vector3.Zero, 0.01f) && _velocityMotor.ErrorIsZero) 787 if (_velocityMotor.TargetValue.ApproxEquals(OMV.Vector3.Zero, 0.01f) && _velocityMotor.ErrorIsZero)
789 { 788 {
789 ZeroMotion(true);
790 stepVelocity = OMV.Vector3.Zero; 790 stepVelocity = OMV.Vector3.Zero;
791 _velocityMotor.Enabled = false; 791 _velocityMotor.Enabled = false;
792 DetailLog("{0},BSCharacter.UpdateProperties,taint,disableVelocityMotor,m={1}", LocalID, _velocityMotor); 792 DetailLog("{0},BSCharacter.UpdateProperties,taint,disableVelocityMotor,m={1}", LocalID, _velocityMotor);