diff options
author | Diva Canto | 2013-05-07 18:02:25 -0700 |
---|---|---|
committer | Diva Canto | 2013-05-07 18:02:25 -0700 |
commit | 6f5222e863ccf93b8194b879dd1ea1eb595ce280 (patch) | |
tree | d9f3e1dddb08b5874e3c0d770a03a40935ac7fa5 | |
parent | Added AvatarPickerSearch capability handler. (diff) | |
parent | Bulletsim: and the rotational friction. (diff) | |
download | opensim-SC_OLD-6f5222e863ccf93b8194b879dd1ea1eb595ce280.zip opensim-SC_OLD-6f5222e863ccf93b8194b879dd1ea1eb595ce280.tar.gz opensim-SC_OLD-6f5222e863ccf93b8194b879dd1ea1eb595ce280.tar.bz2 opensim-SC_OLD-6f5222e863ccf93b8194b879dd1ea1eb595ce280.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 04ea289..c16b7d3 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, |
@@ -1337,11 +1339,13 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1337 | // angularMotorContributionV.Y = 0f; | 1339 | // angularMotorContributionV.Y = 0f; |
1338 | // } | 1340 | // } |
1339 | 1341 | ||
1342 | // Reduce any velocity by friction. | ||
1343 | Vector3 frictionFactorW = ComputeFrictionFactor(m_angularFrictionTimescale, pTimestep); | ||
1344 | angularMotorContributionV -= (currentAngularV * frictionFactorW); | ||
1345 | |||
1340 | VehicleRotationalVelocity += angularMotorContributionV * VehicleOrientation; | 1346 | VehicleRotationalVelocity += angularMotorContributionV * VehicleOrientation; |
1341 | 1347 | ||
1342 | // Reduce any velocity by friction. | 1348 | |
1343 | Vector3 frictionFactorW = ComputeFrictionFactor(m_angularFrictionTimescale, pTimestep) * VehicleOrientation; | ||
1344 | VehicleRotationalVelocity -= (VehicleRotationalVelocity * frictionFactorW); | ||
1345 | 1349 | ||
1346 | VDetailLog("{0}, MoveAngular,angularTurning,angContribV={1}", ControllingPrim.LocalID, angularMotorContributionV); | 1350 | VDetailLog("{0}, MoveAngular,angularTurning,angContribV={1}", ControllingPrim.LocalID, angularMotorContributionV); |
1347 | } | 1351 | } |