From a3aea359b252feb83684b4b19e5fe58a5dc4e2aa Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 12 Sep 2019 13:11:13 +0300 Subject: DragCarToPoint --- src/control/CarCtrl.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/control/CarCtrl.h') diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h index b06c1ca2..f545d492 100644 --- a/src/control/CarCtrl.h +++ b/src/control/CarCtrl.h @@ -25,7 +25,7 @@ class CCarCtrl SPECIAL, BIG, TAXI, - CLASS7, + TOTAL_CUSTOM_CLASSES, MAFIA, TRIAD, DIABLO, @@ -65,7 +65,6 @@ public: static float FindMaximumSpeedForThisCarInTraffic(CVehicle*); static void SlowCarDownForCarsSectorList(CPtrList&, CVehicle*, float, float, float, float, float*, float); static void SlowCarDownForPedsSectorList(CPtrList&, CVehicle*, float, float, float, float, float*, float); - static void Init(void); static void SlowCarDownForOtherCar(CEntity*, CVehicle*, float*, float); static float TestCollisionBetween2MovingRects(CVehicle*, CVehicle*, float, float, CVector*, CVector*, uint8); static float FindAngleToWeaveThroughTraffic(CVehicle*, CPhysical*, float, float); @@ -83,6 +82,9 @@ public: static bool PickNextNodeToFollowPath(CVehicle*); static void PickNextNodeRandomly(CVehicle*); static uint8 FindPathDirection(int32, int32, int32); + static void Init(void); + static void ReInit(void); + static bool ThisRoadObjectCouldMove(int16); static float GetOffsetOfLaneFromCenterOfRoad(int8 lane, CCarPathLink* pLink) { @@ -111,14 +113,17 @@ public: static int32 &NumRandomCars; static int32 &NumMissionCars; static int32 &NumParkedCars; + static int32 &NumPermanentCars; static bool &bCarsGeneratedAroundCamera; static float &CarDensityMultiplier; static int8 &CountDownToCarsAtStart; static int32 &MaxNumberOfCarsInUse; static uint32 &LastTimeLawEnforcerCreated; - static int32 (&TotalNumOfCarsOfRating)[7]; - static int32 (&NextCarOfRating)[7]; - static int32 (&CarArrays)[7][MAX_CAR_MODELS_IN_ARRAY]; + static uint32 &LastTimeFireTruckCreated; + static uint32 &LastTimeAmbulanceCreated; + static int32 (&TotalNumOfCarsOfRating)[TOTAL_CUSTOM_CLASSES]; + static int32 (&NextCarOfRating)[TOTAL_CUSTOM_CLASSES]; + static int32 (&CarArrays)[TOTAL_CUSTOM_CLASSES][MAX_CAR_MODELS_IN_ARRAY]; }; extern CVehicle* (&apCarsToKeep)[MAX_CARS_TO_KEEP]; \ No newline at end of file -- cgit v1.2.3 From 57f24ad5336594c3355c83c2571ea373f6167a62 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 14 Sep 2019 20:53:04 +0300 Subject: more CCarCtrl --- src/control/CarCtrl.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/control/CarCtrl.h') diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h index f545d492..17dc4bf5 100644 --- a/src/control/CarCtrl.h +++ b/src/control/CarCtrl.h @@ -1,5 +1,6 @@ #pragma once #include "PathFind.h" +#include "Boat.h" #include "Vehicle.h" class CZoneInfo; @@ -44,7 +45,6 @@ public: static int32 ChooseCarModel(int32 vehclass); static bool JoinCarWithRoadSystemGotoCoors(CVehicle*, CVector, bool); static void JoinCarWithRoadSystem(CVehicle*); - static void SteerAICarWithPhysics(CVehicle*); static void UpdateCarOnRails(CVehicle*); static bool MapCouldMoveInThisArea(float x, float y); static void ScanForPedDanger(CVehicle *veh); @@ -84,14 +84,18 @@ public: static uint8 FindPathDirection(int32, int32, int32); static void Init(void); static void ReInit(void); + static float FindSpeedMultiplier(float, float, float, float); + static void SteerAICarWithPhysics(CVehicle*); + static void SteerAICarWithPhysics_OnlyMission(CVehicle*, float*, float*, float*, bool*); + static void SteerAIBoatWithPhysics(CBoat*); + static float FindMaxSteerAngle(CVehicle*); + static void SteerAICarWithPhysicsFollowPath(CVehicle*, float*, float*, float*, bool*); + static void SteerAICarWithPhysicsHeadingForTarget(CVehicle*, CPhysical*, float, float, float*, float*, float*, bool*); + static void SteerAICarWithPhysicsTryingToBlockTarget(CVehicle*, float, float, float, float, float*, float*, float*, bool*); + static void SteerAICarWithPhysicsTryingToBlockTarget_Stop(CVehicle*, float, float, float, float, float*, float*, float*, bool*); + static void SteerAIBoatWithPhysicsHeadingForTarget(CBoat*, float, float, float*, float*, float*); static bool ThisRoadObjectCouldMove(int16); - static float GetOffsetOfLaneFromCenterOfRoad(int8 lane, CCarPathLink* pLink) - { - return (lane + ((pLink->numLeftLanes == 0) ? (0.5f - 0.5f * pLink->numRightLanes) : - ((pLink->numRightLanes == 0) ? (0.5f - 0.5f * pLink->numLeftLanes) : 0.5f))) * LANE_WIDTH; - } - static float GetPositionAlongCurrentCurve(CVehicle* pVehicle) { uint32 timeInCurve = CTimer::GetTimeInMilliseconds() - pVehicle->AutoPilot.m_nTimeEnteredCurve; -- cgit v1.2.3