2019-05-19 21:28:10 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Vehicle.h"
|
2019-07-07 18:36:55 +02:00
|
|
|
#include "DamageManager.h"
|
|
|
|
#include "Door.h"
|
2019-07-06 19:44:00 +02:00
|
|
|
|
2019-07-08 21:37:47 +02:00
|
|
|
class CObject;
|
|
|
|
|
2019-05-19 21:28:10 +02:00
|
|
|
class CAutomobile : public CVehicle
|
|
|
|
{
|
|
|
|
public:
|
2019-06-02 17:13:56 +02:00
|
|
|
// 0x288
|
2019-07-06 19:44:00 +02:00
|
|
|
CDamageManager Damage;
|
|
|
|
CDoor Doors[6];
|
|
|
|
RwFrame *m_aCarNodes[NUM_CAR_NODES];
|
|
|
|
CColPoint m_aWheelColPoints[4];
|
2019-07-07 13:09:11 +02:00
|
|
|
float m_aSuspensionSpringRatio[4];
|
|
|
|
float m_aSuspensionSpringRatioPrev[4];
|
2019-07-06 19:44:00 +02:00
|
|
|
float m_aWheelSkidThing[4];
|
2019-07-08 08:46:42 +02:00
|
|
|
float field_49C;
|
2019-07-06 19:44:00 +02:00
|
|
|
bool m_aWheelSkidmarkMuddy[4];
|
|
|
|
bool m_aWheelSkidmarkBloody[4];
|
|
|
|
float m_aWheelRotation[4];
|
|
|
|
float m_aWheelPosition[4];
|
|
|
|
float m_aWheelSpeed[4];
|
2019-07-08 08:46:42 +02:00
|
|
|
uint8 field_4D8;
|
|
|
|
uint8 m_auto_flagA1 : 1;
|
|
|
|
uint8 m_auto_flagA2 : 1;
|
|
|
|
uint8 m_auto_flagA4 : 1;
|
|
|
|
uint8 bTaxiLight : 1;
|
|
|
|
uint8 m_auto_flagA10 : 1;
|
|
|
|
uint8 m_auto_flagA20 : 1;
|
|
|
|
uint8 m_auto_flagA40 : 1;
|
|
|
|
uint8 m_auto_flagA80 : 1;
|
|
|
|
uint8 field_4DA[10];
|
2019-07-06 19:44:00 +02:00
|
|
|
uint32 m_nBusDoorTimerEnd;
|
|
|
|
uint32 m_nBusDoorTimerStart;
|
2019-07-07 13:09:11 +02:00
|
|
|
float m_aSuspensionSpringLength[4];
|
2019-07-06 19:44:00 +02:00
|
|
|
float m_aSuspensionLineLength[4];
|
|
|
|
float m_fHeightAboveRoad;
|
|
|
|
float m_fImprovedHandling;
|
|
|
|
uint8 stuff6[32];
|
|
|
|
CPhysical *m_aGroundPhysical[4]; // physicals touching wheels
|
|
|
|
CVector m_aGroundOffset[4]; // from ground object to colpoint
|
|
|
|
CEntity *m_pBlowUpEntity;
|
|
|
|
float m_weaponThingA; // TODO
|
|
|
|
float m_weaponThingB; // TODO
|
2019-06-25 00:42:23 +02:00
|
|
|
float m_fCarGunLR;
|
2019-07-06 19:44:00 +02:00
|
|
|
float m_fCarGunUD;
|
|
|
|
float m_fWindScreenRotation;
|
|
|
|
uint8 stuff4[4];
|
|
|
|
uint8 m_nWheelsOnGround_2;
|
|
|
|
uint8 m_nWheelsOnGround;
|
|
|
|
uint8 m_nWheelsOnGroundPrev;
|
|
|
|
uint8 stuff5[5];
|
|
|
|
int32 m_aWheelState[4];
|
2019-06-25 00:42:23 +02:00
|
|
|
|
2019-07-08 08:46:42 +02:00
|
|
|
static bool &m_sAllTaxiLights;
|
|
|
|
|
2019-06-30 12:59:55 +02:00
|
|
|
CAutomobile(int, uint8);
|
2019-07-08 08:46:42 +02:00
|
|
|
|
|
|
|
// from CEntity
|
|
|
|
void SetModelIndex(uint32 id);
|
|
|
|
void ProcessControl(void);
|
|
|
|
void Teleport(CVector v);
|
|
|
|
void PreRender(void);
|
|
|
|
void Render(void);
|
|
|
|
|
2019-07-09 09:57:44 +02:00
|
|
|
// from CPhysical
|
|
|
|
int32 ProcessEntityCollision(CEntity *ent, CColPoint *colpoints);
|
|
|
|
|
2019-07-08 08:46:42 +02:00
|
|
|
// from CVehicle
|
|
|
|
void ProcessControlInputs(uint8);
|
|
|
|
void GetComponentWorldPosition(int32 component, CVector &pos);
|
|
|
|
bool IsComponentPresent(int32 component);
|
|
|
|
void SetComponentRotation(int32 component, CVector rotation);
|
2019-07-08 21:37:47 +02:00
|
|
|
void OpenDoor(int32 component, eDoors door, float openRatio);
|
2019-07-08 08:46:42 +02:00
|
|
|
void ProcessOpenDoor(uint32, uint32, float);
|
|
|
|
bool IsDoorReady(eDoors door);
|
|
|
|
bool IsDoorFullyOpen(eDoors door);
|
|
|
|
bool IsDoorClosed(eDoors door);
|
|
|
|
bool IsDoorMissing(eDoors door);
|
|
|
|
void RemoveRefsToVehicle(CEntity *ent);
|
|
|
|
void BlowUpCar(CEntity *ent);
|
|
|
|
bool SetUpWheelColModel(CColModel *colModel);
|
|
|
|
void BurstTyre(uint8 tyre);
|
|
|
|
bool IsRoomForPedToLeaveCar(uint32, CVector *);
|
|
|
|
float GetHeightAboveRoad(void);
|
|
|
|
void PlayCarHorn(void);
|
|
|
|
|
2019-07-09 09:57:44 +02:00
|
|
|
void PlayHornIfNecessary(void);
|
2019-07-08 21:37:47 +02:00
|
|
|
void ResetSuspension(void);
|
2019-07-09 09:57:44 +02:00
|
|
|
void SetupSuspensionLines(void);
|
2019-07-09 18:50:35 +02:00
|
|
|
void ScanForCrimes(void);
|
|
|
|
void BlowUpCarsInPath(void);
|
2019-07-09 09:57:44 +02:00
|
|
|
bool HasCarStoppedBecauseOfLight(void);
|
|
|
|
void SetBusDoorTimer(uint32 timer, uint8 type);
|
|
|
|
void ProcessAutoBusDoors(void);
|
|
|
|
void ProcessSwingingDoor(int32 component, eDoors door);
|
2019-07-08 21:37:47 +02:00
|
|
|
void SetupDamageAfterLoad(void);
|
|
|
|
CObject *SpawnFlyingComponent(int32 component, uint32 type);
|
|
|
|
CObject *RemoveBonnetInPedCollision(void);
|
|
|
|
void SetPanelDamage(int32 component, ePanels panel, bool noFlyingComponents = false);
|
|
|
|
void SetBumperDamage(int32 component, ePanels panel, bool noFlyingComponents = false);
|
|
|
|
void SetDoorDamage(int32 component, eDoors door, bool noFlyingComponents = false);
|
2019-07-08 08:46:42 +02:00
|
|
|
|
2019-07-08 21:37:47 +02:00
|
|
|
void Fix(void);
|
2019-07-08 08:46:42 +02:00
|
|
|
void SetComponentVisibility(RwFrame *frame, uint32 flags);
|
|
|
|
void SetupModelNodes(void);
|
|
|
|
void SetTaxiLight(bool light);
|
|
|
|
bool GetAllWheelsOffGround(void);
|
|
|
|
void HideAllComps(void);
|
|
|
|
void ShowAllComps(void);
|
|
|
|
void ReduceHornCounter(void);
|
|
|
|
|
|
|
|
static void SetAllTaxiLights(bool set);
|
|
|
|
|
2019-06-30 12:59:55 +02:00
|
|
|
CAutomobile* ctor(int, uint8);
|
2019-05-19 21:28:10 +02:00
|
|
|
};
|
|
|
|
static_assert(sizeof(CAutomobile) == 0x5A8, "CAutomobile: error");
|