diff options
author | Robert Adams | 2013-01-25 16:52:16 -0800 |
---|---|---|
committer | Robert Adams | 2013-01-27 12:50:05 -0800 |
commit | 36f401d85011b0ffb548e79923381be894dbfabb (patch) | |
tree | a40639407a7c8b8d258997b8f55838a3f9f754c3 /OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |
parent | BulletSim: first attempt at reporting top colliders (diff) | |
download | opensim-SC_OLD-36f401d85011b0ffb548e79923381be894dbfabb.zip opensim-SC_OLD-36f401d85011b0ffb548e79923381be894dbfabb.tar.gz opensim-SC_OLD-36f401d85011b0ffb548e79923381be894dbfabb.tar.bz2 opensim-SC_OLD-36f401d85011b0ffb548e79923381be894dbfabb.tar.xz |
BulletSim: parameterize the value for gravity reduction for ground vehicles on the ground. Set defaults for vehicle factors to one. Debug logging changes.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 15 |
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 | // ======================================================================= |