diff options
author | Melanie | 2013-05-07 00:30:59 +0100 |
---|---|---|
committer | Melanie | 2013-05-07 00:30:59 +0100 |
commit | 54d0cd85ad52d8b29265a12afd617728dbf609ae (patch) | |
tree | c7ea8cca078b92c6aad7f16e6969e8f30ceb7ebe /OpenSim | |
parent | Merge branch 'master' into careminster (diff) | |
parent | BulletSim: apply linear and angular friction in vehicle coordinates (diff) | |
download | opensim-SC-54d0cd85ad52d8b29265a12afd617728dbf609ae.zip opensim-SC-54d0cd85ad52d8b29265a12afd617728dbf609ae.tar.gz opensim-SC-54d0cd85ad52d8b29265a12afd617728dbf609ae.tar.bz2 opensim-SC-54d0cd85ad52d8b29265a12afd617728dbf609ae.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 272a162..04ea289 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -1042,12 +1042,12 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1042 | VehicleVelocity += linearMotorVelocityW; | 1042 | VehicleVelocity += linearMotorVelocityW; |
1043 | 1043 | ||
1044 | // Friction reduces vehicle motion | 1044 | // Friction reduces vehicle motion |
1045 | Vector3 frictionFactor = ComputeFrictionFactor(m_linearFrictionTimescale, pTimestep); | 1045 | Vector3 frictionFactorW = ComputeFrictionFactor(m_linearFrictionTimescale, pTimestep) * VehicleOrientation; |
1046 | VehicleVelocity -= (VehicleVelocity * frictionFactor); | 1046 | VehicleVelocity -= (VehicleVelocity * frictionFactorW); |
1047 | 1047 | ||
1048 | VDetailLog("{0}, MoveLinear,velocity,origVelW={1},velV={2},correctV={3},correctW={4},newVelW={5},fricFact={6}", | 1048 | VDetailLog("{0}, MoveLinear,velocity,origVelW={1},velV={2},correctV={3},correctW={4},newVelW={5},fricFact={6}", |
1049 | ControllingPrim.LocalID, origVelW, currentVelV, linearMotorCorrectionV, | 1049 | ControllingPrim.LocalID, origVelW, currentVelV, linearMotorCorrectionV, |
1050 | linearMotorVelocityW, VehicleVelocity, frictionFactor); | 1050 | linearMotorVelocityW, VehicleVelocity, frictionFactorW); |
1051 | } | 1051 | } |
1052 | 1052 | ||
1053 | public void ComputeLinearTerrainHeightCorrection(float pTimestep) | 1053 | public void ComputeLinearTerrainHeightCorrection(float pTimestep) |
@@ -1340,10 +1340,10 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1340 | VehicleRotationalVelocity += angularMotorContributionV * VehicleOrientation; | 1340 | VehicleRotationalVelocity += angularMotorContributionV * VehicleOrientation; |
1341 | 1341 | ||
1342 | // Reduce any velocity by friction. | 1342 | // Reduce any velocity by friction. |
1343 | Vector3 frictionFactor = ComputeFrictionFactor(m_angularFrictionTimescale, pTimestep); | 1343 | Vector3 frictionFactorW = ComputeFrictionFactor(m_angularFrictionTimescale, pTimestep) * VehicleOrientation; |
1344 | VehicleRotationalVelocity -= (VehicleRotationalVelocity * frictionFactor); | 1344 | VehicleRotationalVelocity -= (VehicleRotationalVelocity * frictionFactorW); |
1345 | 1345 | ||
1346 | VDetailLog("{0}, MoveAngular,angularTurning,angularMotorContrib={1}", ControllingPrim.LocalID, angularMotorContributionV); | 1346 | VDetailLog("{0}, MoveAngular,angularTurning,angContribV={1}", ControllingPrim.LocalID, angularMotorContributionV); |
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | // From http://wiki.secondlife.com/wiki/Linden_Vehicle_Tutorial: | 1349 | // From http://wiki.secondlife.com/wiki/Linden_Vehicle_Tutorial: |