aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs15
1 files changed, 8 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
index 06b4620..90482fd 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -976,8 +976,9 @@ namespace OpenSim.Region.Physics.BulletSPlugin
976 public void ComputeLinearVelocity(float pTimestep) 976 public void ComputeLinearVelocity(float pTimestep)
977 { 977 {
978 // Step the motor from the current value. Get the correction needed this step. 978 // Step the motor from the current value. Get the correction needed this step.
979 Vector3 currentVel = VehicleVelocity * Quaternion.Inverse(VehicleOrientation); 979 Vector3 origVelW = VehicleVelocity; // DEBUG
980 Vector3 linearMotorCorrectionV = m_linearMotor.Step(pTimestep, currentVel); 980 Vector3 currentVelV = VehicleVelocity * Quaternion.Inverse(VehicleOrientation);
981 Vector3 linearMotorCorrectionV = m_linearMotor.Step(pTimestep, currentVelV);
981 982
982 // Motor is vehicle coordinates. Rotate it to world coordinates 983 // Motor is vehicle coordinates. Rotate it to world coordinates
983 Vector3 linearMotorVelocityW = linearMotorCorrectionV * VehicleOrientation; 984 Vector3 linearMotorVelocityW = linearMotorCorrectionV * VehicleOrientation;
@@ -992,8 +993,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin
992 // Add this correction to the velocity to make it faster/slower. 993 // Add this correction to the velocity to make it faster/slower.
993 VehicleVelocity += linearMotorVelocityW; 994 VehicleVelocity += linearMotorVelocityW;
994 995
995 VDetailLog("{0}, MoveLinear,velocity,vehVel={1},correction={2},force={3}", 996 VDetailLog("{0}, MoveLinear,velocity,origVelW={1},velV={2},correctV={3},correctW={4},newVelW={5}",
996 Prim.LocalID, VehicleVelocity, linearMotorCorrectionV, linearMotorVelocityW); 997 Prim.LocalID, origVelW, currentVelV, linearMotorCorrectionV, linearMotorVelocityW, VehicleVelocity);
997 } 998 }
998 999
999 public void ComputeLinearTerrainHeightCorrection(float pTimestep) 1000 public void ComputeLinearTerrainHeightCorrection(float pTimestep)
@@ -1193,12 +1194,12 @@ namespace OpenSim.Region.Physics.BulletSPlugin
1193 1194
1194 // Hack to reduce downward force if the vehicle is probably sitting on the ground 1195 // Hack to reduce downward force if the vehicle is probably sitting on the ground
1195 if (Prim.IsColliding && IsGroundVehicle) 1196 if (Prim.IsColliding && IsGroundVehicle)
1196 appliedGravity *= 0.2f; 1197 appliedGravity *= BSParam.VehicleGroundGravityFudge;
1197 1198
1198 VehicleAddForce(appliedGravity); 1199 VehicleAddForce(appliedGravity);
1199 1200
1200 VDetailLog("{0}, MoveLinear,applyGravity,vehGrav={1},appliedForce-{2}", 1201 VDetailLog("{0}, MoveLinear,applyGravity,vehGrav={1},collid={2},appliedForce={3}",
1201 Prim.LocalID, m_VehicleGravity, appliedGravity); 1202 Prim.LocalID, m_VehicleGravity, Prim.IsColliding, appliedGravity);
1202 } 1203 }
1203 1204
1204 // ======================================================================= 1205 // =======================================================================