瀏覽代碼

Merge pull request #29940 from jonri/fix-vehicle-contact

Prevent VehicleBody contact damping from exceeding the baseline value…
Rémi Verschelde 6 年之前
父節點
當前提交
29cddef895
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/3d/vehicle_body.cpp

+ 1 - 1
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