summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Ring <jonnyring@gmail.com>2019-06-18 17:40:49 -0400
committerJon Ring <jonnyring@gmail.com>2019-06-18 17:40:49 -0400
commitb2d433c4a81f148e2c022fcdef10f903029b6347 (patch)
tree0b63ee2e31e7340ec097be1f54ee87d3cca4465f
parent0ac3687d6fe3bfa90f5cfbdf7c28752de1b627f0 (diff)
Prevent VehicleBody contact damping from exceeding the baseline value when roll influence is very small.
When contact damping exceeds 1.0, the wheels will lose grip when the vehicle is not moving.
-rw-r--r--scene/3d/vehicle_body.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index 32b8219ee0..55bb7eabd9 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -585,7 +585,7 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec
if (p_rollInfluence > 0.0) {
// !BAS! But seeing we apply this frame by frame, makes more sense to me to make this time based
// keeping in mind our anti roll factor if it is set
- contactDamping = s->get_step() / p_rollInfluence;
+ contactDamping = MIN(contactDamping, s->get_step() / p_rollInfluence);
}
#define ONLY_USE_LINEAR_MASS