Fix lift-induced drag calculation

more-targets
Titan Yuan 2024-09-16 22:47:40 -07:00
parent cfd5653620
commit 7330102735
1 changed files with 2 additions and 1 deletions

View File

@ -131,7 +131,8 @@ public class Missile : Agent {
} }
private float CalculateLiftInducedDrag(Vector3 accelerationInput) { private float CalculateLiftInducedDrag(Vector3 accelerationInput) {
float liftAcceleration = Vector3.Dot(accelerationInput, transform.forward); float liftAcceleration =
(accelerationInput - Vector3.Dot(accelerationInput, transform.up) * transform.up).magnitude;
float liftDragRatio = StaticConfig.liftDragConfig.liftDragRatio; float liftDragRatio = StaticConfig.liftDragConfig.liftDragRatio;
return Mathf.Abs(liftAcceleration / liftDragRatio); return Mathf.Abs(liftAcceleration / liftDragRatio);
} }