summaryrefslogtreecommitdiffstats
path: root/src/control/CarCtrl.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-05-27 15:53:50 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-24 20:32:43 +0200
commita11bf19b9341a77ce57ba8bd00eb0bf5d2dcc7a8 (patch)
tree2577a11bb5507a14fdfdbcb74ab79912e0969a98 /src/control/CarCtrl.cpp
parentFix IsSphereVisible calls (diff)
downloadre3-a11bf19b9341a77ce57ba8bd00eb0bf5d2dcc7a8.tar
re3-a11bf19b9341a77ce57ba8bd00eb0bf5d2dcc7a8.tar.gz
re3-a11bf19b9341a77ce57ba8bd00eb0bf5d2dcc7a8.tar.bz2
re3-a11bf19b9341a77ce57ba8bd00eb0bf5d2dcc7a8.tar.lz
re3-a11bf19b9341a77ce57ba8bd00eb0bf5d2dcc7a8.tar.xz
re3-a11bf19b9341a77ce57ba8bd00eb0bf5d2dcc7a8.tar.zst
re3-a11bf19b9341a77ce57ba8bd00eb0bf5d2dcc7a8.zip
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r--src/control/CarCtrl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 2e9752a7..0516e214 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -1330,8 +1330,8 @@ void CCarCtrl::WeaveForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle, float
forward.NormaliseSafe();
float forwardAngle = CGeneral::GetATanOfXY(forward.x, forward.y);
float angleDiff = angleBetweenVehicles - forwardAngle;
- float lenProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.y * sin(angleDiff));
- float widthProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.x * cos(angleDiff));
+ float lenProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.y * Sin(angleDiff));
+ float widthProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.x * Cos(angleDiff));
float lengthToEvade = (2 * (lenProjection + widthProjection) + WIDTH_COEF_TO_WEAVE_SAFELY * 2 * pVehicle->GetColModel()->boundingBox.max.x) / distance;
float diffToLeftAngle = LimitRadianAngle(angleBetweenVehicles - *pAngleToWeaveLeft);
diffToLeftAngle = ABS(diffToLeftAngle);