diff options
| author | Bastiaan Olij | 2018-05-26 08:26:39 +1000 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-06-01 17:59:15 +0200 |
| commit | 77542276f82d2e707524710bdb64555b6c51165a (patch) | |
| tree | 2610331968c524fd9021b398461aa439697b711e | |
| parent | 0a3779135d8ca16259edc668dffdfb4aba3d55aa (diff) | |
| download | godot-77542276f82d2e707524710bdb64555b6c51165a.tar.gz godot-77542276f82d2e707524710bdb64555b6c51165a.tar.zst godot-77542276f82d2e707524710bdb64555b6c51165a.zip | |
Check for 0 roll influence
(cherry picked from commit 660bebec94a6e4ce6b0d5c5e4af8ec8403845009)
| -rw-r--r-- | scene/3d/vehicle_body.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index b72665aa2..c6d4c0b7e 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -583,11 +583,14 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec rel_vel = normal.dot(vel); // !BAS! We had this set to 0.4, in bullet its 0.2 - // real_t contactDamping = real_t(0.2); + real_t contactDamping = real_t(0.2); + + 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; + } - // !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 - real_t contactDamping = s->get_step() / p_rollInfluence; #define ONLY_USE_LINEAR_MASS #ifdef ONLY_USE_LINEAR_MASS real_t massTerm = real_t(1.) / ((1.0 / mass) + b2invmass); |
