summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-06-05 12:03:14 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-24 20:34:33 +0200
commit6e4a2947ea55fc19ba1ba7f10c08a2ed1d54d135 (patch)
tree155c002e306a392095602f49c74ef82a3fb3fba9 /src/control
parentFix IsSphereVisible calls (diff)
downloadre3-6e4a2947ea55fc19ba1ba7f10c08a2ed1d54d135.tar
re3-6e4a2947ea55fc19ba1ba7f10c08a2ed1d54d135.tar.gz
re3-6e4a2947ea55fc19ba1ba7f10c08a2ed1d54d135.tar.bz2
re3-6e4a2947ea55fc19ba1ba7f10c08a2ed1d54d135.tar.lz
re3-6e4a2947ea55fc19ba1ba7f10c08a2ed1d54d135.tar.xz
re3-6e4a2947ea55fc19ba1ba7f10c08a2ed1d54d135.tar.zst
re3-6e4a2947ea55fc19ba1ba7f10c08a2ed1d54d135.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/CarCtrl.cpp4
-rw-r--r--src/control/Script2.cpp4
-rw-r--r--src/control/Script5.cpp8
3 files changed, 8 insertions, 8 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 8db6fd95..21526d5e 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -1581,8 +1581,8 @@ void CCarCtrl::WeaveForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle, float
forward.Normalise();
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);
diff --git a/src/control/Script2.cpp b/src/control/Script2.cpp
index 656973ca..4e7a1c3e 100644
--- a/src/control/Script2.cpp
+++ b/src/control/Script2.cpp
@@ -431,8 +431,8 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
float length = *(float*)&ScriptParams[5];
float x, y;
if (angle != 0.0f){
- y = cos(angle) * length;
- x = sin(angle) * length;
+ y = Cos(angle) * length;
+ x = Sin(angle) * length;
}else{
y = length;
x = 0.0f;
diff --git a/src/control/Script5.cpp b/src/control/Script5.cpp
index 1371f2e6..9d14b1c4 100644
--- a/src/control/Script5.cpp
+++ b/src/control/Script5.cpp
@@ -1006,10 +1006,10 @@ void CRunningScript::PlayerInAngledAreaCheckCommand(int32 command, uint32* pIp)
initAngle -= TWOPI;
// it looks like the idea is to use a rectangle using the diagonal of the rectangle as
// the side of new rectangle, with "length" being the length of second side
- float rotatedSupX = supX + side2length * sin(initAngle);
- float rotatedSupY = supY - side2length * cos(initAngle);
- float rotatedInfX = infX + side2length * sin(initAngle);
- float rotatedInfY = infY - side2length * cos(initAngle);
+ float rotatedSupX = supX + side2length * Sin(initAngle);
+ float rotatedSupY = supY - side2length * Cos(initAngle);
+ float rotatedInfX = infX + side2length * Sin(initAngle);
+ float rotatedInfY = infY - side2length * Cos(initAngle);
float side1X = supX - infX;
float side1Y = supY - infY;
float side1Length = CVector2D(side1X, side1Y).Magnitude();