From 7339ebce60eaab4dd229e4fb95e333e57300cbfe Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Mon, 16 Nov 2020 12:21:50 +0300 Subject: lcs car ctrl 1 --- src/control/CarCtrl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/control/CarCtrl.h') diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h index 5efbe275..61ebb35c 100644 --- a/src/control/CarCtrl.h +++ b/src/control/CarCtrl.h @@ -130,6 +130,9 @@ public: static void SteerAIBoatWithPhysicsAttackingPlayer(CVehicle*, float*, float*, float*, bool*); static void SteerAICarBlockingPlayerForwardAndBack(CVehicle*, float*, float*, float*, bool*); + static bool OkToCreateVehicleAtThisPosition(const CVector&) { return true; } + static float GetATanOfXY(float x, float y) { float t = CGeneral::GetATanOfXY(x, y); if (t < 0.0f) t += TWOPI; return t; } // TODO(LCS): replace where required + static float GetPositionAlongCurrentCurve(CVehicle* pVehicle) { uint32 timeInCurve = CTimer::GetTimeInMilliseconds() - pVehicle->AutoPilot.m_nTimeEnteredCurve; -- cgit v1.2.3 From b9b9dabd7540faa4ce78159908c3c80b3253468e Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Mon, 16 Nov 2020 22:20:56 +0300 Subject: lcs car ctrl 2 --- src/control/CarCtrl.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/control/CarCtrl.h') diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h index 61ebb35c..fcb7929b 100644 --- a/src/control/CarCtrl.h +++ b/src/control/CarCtrl.h @@ -1,6 +1,7 @@ #pragma once #include "PathFind.h" #include "Boat.h" +#include "General.h" #include "Vehicle.h" #define GAME_SPEED_TO_METERS_PER_SECOND 50.0f @@ -130,8 +131,9 @@ public: static void SteerAIBoatWithPhysicsAttackingPlayer(CVehicle*, float*, float*, float*, bool*); static void SteerAICarBlockingPlayerForwardAndBack(CVehicle*, float*, float*, float*, bool*); - static bool OkToCreateVehicleAtThisPosition(const CVector&) { return true; } - static float GetATanOfXY(float x, float y) { float t = CGeneral::GetATanOfXY(x, y); if (t < 0.0f) t += TWOPI; return t; } // TODO(LCS): replace where required + static bool OkToCreateVehicleAtThisPosition(const CVector&); + static void RenderDebugInfo(CVehicle*); + static float GetATanOfXY(float x, float y) { float t = CGeneral::GetATanOfXY(x, y); if (t < 0.0f) t += TWOPI; return t; } static float GetPositionAlongCurrentCurve(CVehicle* pVehicle) { @@ -141,11 +143,7 @@ public: static float LimitRadianAngle(float angle) { - while (angle < -PI) - angle += TWOPI; - while (angle > PI) - angle -= TWOPI; - return angle; + return CGeneral::LimitRadianAngle(angle); } static bool bMadDriversCheat; -- cgit v1.2.3