From 29cdf0f3dd99605192f29fc83bbacdf8ecb0ea8d Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 18 Dec 2012 15:00:10 -0500 Subject: * Merges BulletSim Updates to BulletSimN(BulletSNPlugin) --- OpenSim/Region/Physics/BulletSNPlugin/BSCharacter.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSNPlugin/BSCharacter.cs') 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 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, BSParam.CcdSweptSphereRadius); } - UpdatePhysicalMassProperties(RawMass); + UpdatePhysicalMassProperties(RawMass, false); // Make so capsule does not fall over BulletSimAPI.SetAngularFactorV2(PhysBody.ptr, OMV.Vector3.Zero); @@ -224,7 +224,7 @@ public sealed class BSCharacter : BSPhysObject if (PhysBody.HasPhysicalBody && PhysShape.HasPhysicalShape) { BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale); - UpdatePhysicalMassProperties(RawMass); + UpdatePhysicalMassProperties(RawMass, true); // Make sure this change appears as a property update event BulletSimAPI.PushUpdate2(PhysBody.ptr); } @@ -260,7 +260,6 @@ public sealed class BSCharacter : BSPhysObject public override void ZeroMotion(bool inTaintTime) { _velocity = OMV.Vector3.Zero; - _velocityMotor.Zero(); _acceleration = OMV.Vector3.Zero; _rotationalVelocity = OMV.Vector3.Zero; @@ -390,7 +389,7 @@ public sealed class BSCharacter : BSPhysObject public override float RawMass { get {return _mass; } } - public override void UpdatePhysicalMassProperties(float physMass) + public override void UpdatePhysicalMassProperties(float physMass, bool inWorld) { OMV.Vector3 localInertia = BulletSimAPI.CalculateLocalInertia2(PhysShape.ptr, physMass); BulletSimAPI.SetMassProps2(PhysBody.ptr, physMass, localInertia); @@ -787,6 +786,7 @@ public sealed class BSCharacter : BSPhysObject // the motor can be turned off. Set the velocity to zero so the zero motion is sent to the viewer. if (_velocityMotor.TargetValue.ApproxEquals(OMV.Vector3.Zero, 0.01f) && _velocityMotor.ErrorIsZero) { + ZeroMotion(true); stepVelocity = OMV.Vector3.Zero; _velocityMotor.Enabled = false; DetailLog("{0},BSCharacter.UpdateProperties,taint,disableVelocityMotor,m={1}", LocalID, _velocityMotor); -- cgit v1.1