diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 04ea289..e93dbd7 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -1028,6 +1028,10 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1028 | Vector3 currentVelV = VehicleVelocity * Quaternion.Inverse(VehicleOrientation); | 1028 | Vector3 currentVelV = VehicleVelocity * Quaternion.Inverse(VehicleOrientation); |
1029 | Vector3 linearMotorCorrectionV = m_linearMotor.Step(pTimestep, currentVelV); | 1029 | Vector3 linearMotorCorrectionV = m_linearMotor.Step(pTimestep, currentVelV); |
1030 | 1030 | ||
1031 | // Friction reduces vehicle motion | ||
1032 | Vector3 frictionFactorW = ComputeFrictionFactor(m_linearFrictionTimescale, pTimestep); | ||
1033 | linearMotorCorrectionV -= (currentVelV * frictionFactorW); | ||
1034 | |||
1031 | // Motor is vehicle coordinates. Rotate it to world coordinates | 1035 | // Motor is vehicle coordinates. Rotate it to world coordinates |
1032 | Vector3 linearMotorVelocityW = linearMotorCorrectionV * VehicleOrientation; | 1036 | Vector3 linearMotorVelocityW = linearMotorCorrectionV * VehicleOrientation; |
1033 | 1037 | ||
@@ -1041,9 +1045,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1041 | // Add this correction to the velocity to make it faster/slower. | 1045 | // Add this correction to the velocity to make it faster/slower. |
1042 | VehicleVelocity += linearMotorVelocityW; | 1046 | VehicleVelocity += linearMotorVelocityW; |
1043 | 1047 | ||
1044 | // Friction reduces vehicle motion | 1048 | |
1045 | Vector3 frictionFactorW = ComputeFrictionFactor(m_linearFrictionTimescale, pTimestep) * VehicleOrientation; | ||
1046 | VehicleVelocity -= (VehicleVelocity * frictionFactorW); | ||
1047 | 1049 | ||
1048 | VDetailLog("{0}, MoveLinear,velocity,origVelW={1},velV={2},correctV={3},correctW={4},newVelW={5},fricFact={6}", | 1050 | VDetailLog("{0}, MoveLinear,velocity,origVelW={1},velV={2},correctV={3},correctW={4},newVelW={5},fricFact={6}", |
1049 | ControllingPrim.LocalID, origVelW, currentVelV, linearMotorCorrectionV, | 1051 | ControllingPrim.LocalID, origVelW, currentVelV, linearMotorCorrectionV, |