diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index f1ef449..7ad7c89 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -158,6 +158,12 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
158 | get { return (Type != Vehicle.TYPE_NONE && Prim.IsPhysicallyActive); } | 158 | get { return (Type != Vehicle.TYPE_NONE && Prim.IsPhysicallyActive); } |
159 | } | 159 | } |
160 | 160 | ||
161 | // Return 'true' if this a vehicle that should be sitting on the ground | ||
162 | public bool IsGroundVehicle | ||
163 | { | ||
164 | get { return (Type == Vehicle.TYPE_CAR || Type == Vehicle.TYPE_SLED); } | ||
165 | } | ||
166 | |||
161 | #region Vehicle parameter setting | 167 | #region Vehicle parameter setting |
162 | internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) | 168 | internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) |
163 | { | 169 | { |
@@ -1176,6 +1182,11 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1176 | private void ApplyGravity(float pTimeStep) | 1182 | private void ApplyGravity(float pTimeStep) |
1177 | { | 1183 | { |
1178 | Vector3 appliedGravity = m_VehicleGravity * m_vehicleMass; | 1184 | Vector3 appliedGravity = m_VehicleGravity * m_vehicleMass; |
1185 | |||
1186 | // Hack to reduce downward force if the vehicle is probably sitting on the ground | ||
1187 | if (Prim.IsColliding && IsGroundVehicle) | ||
1188 | appliedGravity *= 0.2f; | ||
1189 | |||
1179 | VehicleAddForce(appliedGravity); | 1190 | VehicleAddForce(appliedGravity); |
1180 | 1191 | ||
1181 | VDetailLog("{0}, MoveLinear,applyGravity,vehGrav={1},appliedForce-{2}", | 1192 | VDetailLog("{0}, MoveLinear,applyGravity,vehGrav={1},appliedForce-{2}", |