1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-18 12:07:45 +00:00
re3/src/vehicles/HandlingMgr.h

256 lines
5.6 KiB
C
Raw Normal View History

2019-06-17 08:30:02 +00:00
#pragma once
2019-06-19 21:41:43 +00:00
#include "Transmission.h"
2020-11-24 15:15:51 +00:00
enum tVehicleType
2019-06-19 21:41:43 +00:00
{
HANDLING_LANDSTAL,
HANDLING_IDAHO,
HANDLING_STINGER,
HANDLING_LINERUN,
HANDLING_PEREN,
HANDLING_SENTINEL,
HANDLING_PATRIOT,
HANDLING_FIRETRUK,
HANDLING_TRASH,
HANDLING_STRETCH,
HANDLING_MANANA,
HANDLING_INFERNUS,
HANDLING_PONY,
HANDLING_MULE,
HANDLING_CHEETAH,
HANDLING_AMBULAN,
HANDLING_FBICAR,
HANDLING_MOONBEAM,
HANDLING_ESPERANT,
HANDLING_TAXI,
HANDLING_KURUMA,
HANDLING_BOBCAT,
HANDLING_MRWHOOP,
HANDLING_BFINJECT,
HANDLING_POLICE,
HANDLING_ENFORCER,
HANDLING_SECURICA,
HANDLING_BANSHEE,
HANDLING_BUS,
HANDLING_RHINO,
HANDLING_BARRACKS,
HANDLING_TRAIN,
2021-01-08 00:41:40 +00:00
HANDLING_FERRY,
2019-06-19 21:41:43 +00:00
HANDLING_HELI,
HANDLING_DODO,
HANDLING_COACH,
HANDLING_CABBIE,
HANDLING_STALLION,
HANDLING_RUMPO,
HANDLING_RCBANDIT,
HANDLING_MAFIA,
HANDLING_AIRTRAIN,
HANDLING_DEADDODO,
HANDLING_FLATBED,
HANDLING_YANKEE,
2021-01-08 00:41:40 +00:00
HANDLING_BLISTA,
HANDLING_BELLYUP,
HANDLING_MRWONGS,
HANDLING_YARDIE,
HANDLING_YAKUZA,
HANDLING_DIABLOS,
HANDLING_COLUMB,
HANDLING_HOODS,
HANDLING_PANLANT,
HANDLING_BORGNINE,
HANDLING_CAMPVAN,
HANDLING_BALLOT,
HANDLING_SPIDER,
HANDLING_SHELBY,
HANDLING_PONTIAC,
HANDLING_ESPRIT,
HANDLING_MINI,
HANDLING_HOTROD,
HANDLING_SINDACCO,
HANDLING_FORELLI,
2020-05-19 11:07:12 +00:00
2020-05-10 15:09:14 +00:00
HANDLING_BIKE,
HANDLING_MOPED,
HANDLING_DIRTBIKE,
HANDLING_ANGEL,
2021-01-08 00:41:40 +00:00
HANDLING_DIRTBIK2,
HANDLING_ANGE2,
2020-05-10 15:09:14 +00:00
HANDLING_FREEWAY,
2020-05-19 11:07:12 +00:00
2020-05-10 15:09:14 +00:00
HANDLING_PREDATOR,
HANDLING_SPEEDER,
HANDLING_REEFER,
2021-01-08 00:41:40 +00:00
2020-05-10 15:09:14 +00:00
HANDLING_MAVERICK,
HANDLING_COASTMAV,
HANDLING_POLMAV,
HANDLING_HUNTER,
HANDLING_RCGOBLIN,
2020-05-19 11:07:12 +00:00
HANDLING_RCCOPTER,
NUMHANDLINGS,
NUMBIKEHANDLINGS = HANDLING_FREEWAY+1 - HANDLING_BIKE,
2021-01-08 00:41:40 +00:00
NUMFLYINGHANDLINGS = HANDLING_RCCOPTER+1 - HANDLING_MAVERICK,
NUMBOATHANDLINGS = HANDLING_COASTMAV+1 - HANDLING_PREDATOR,
2019-06-19 21:41:43 +00:00
};
2020-12-07 00:04:23 +00:00
enum tField // most likely a handling field enum, never used so :shrug:
{
};
2019-06-19 21:41:43 +00:00
enum
{
HANDLING_1G_BOOST = 1,
HANDLING_2G_BOOST = 2,
HANDLING_REV_BONNET = 4,
HANDLING_HANGING_BOOT = 8,
HANDLING_NO_DOORS = 0x10,
HANDLING_IS_VAN = 0x20,
HANDLING_IS_BUS = 0x40,
HANDLING_IS_LOW = 0x80,
HANDLING_DBL_EXHAUST = 0x100,
HANDLING_TAILGATE_BOOT = 0x200,
HANDLING_NOSWING_BOOT = 0x400,
HANDLING_NONPLAYER_STABILISER = 0x800,
HANDLING_NEUTRALHANDLING = 0x1000,
HANDLING_HAS_NO_ROOF = 0x2000,
HANDLING_IS_BIG = 0x4000,
HANDLING_HALOGEN_LIGHTS = 0x8000,
2020-05-10 15:09:14 +00:00
HANDLING_IS_BIKE = 0x10000,
HANDLING_IS_HELI = 0x20000,
HANDLING_IS_PLANE = 0x40000,
HANDLING_IS_BOAT = 0x80000,
HANDLING_NO_EXHAUST = 0x100000,
HANDLING_REARWHEEL_1ST = 0x200000,
HANDLING_HANDBRAKE_TYRE = 0x400000,
HANDLING_SIT_IN_BOAT = 0x800000,
HANDLING_FAT_REARW = 0x1000000,
HANDLING_NARROW_FRONTW = 0x2000000,
HANDLING_GOOD_INSAND = 0x4000000,
2020-05-11 15:03:32 +00:00
HANDLING_UNKNOWN = 0x8000000, // something for helis and planes
2019-06-19 21:41:43 +00:00
};
struct tHandlingData
{
2020-11-24 15:15:51 +00:00
tVehicleType nIdentifier;
2019-06-19 21:41:43 +00:00
float fMass;
float fInvMass;
float fTurnMass;
CVector Dimension;
CVector CentreOfMass;
int8 nPercentSubmerged;
float fBuoyancy;
float fTractionMultiplier;
cTransmission Transmission;
2019-06-19 21:41:43 +00:00
float fBrakeDeceleration;
float fBrakeBias;
int8 bABS;
float fSteeringLock;
float fTractionLoss;
float fTractionBias;
2020-12-27 19:38:03 +00:00
float fUnused;
2019-06-19 21:41:43 +00:00
float fSuspensionForceLevel;
float fSuspensionDampingLevel;
float fSuspensionUpperLimit;
float fSuspensionLowerLimit;
float fSuspensionBias;
2020-05-19 11:07:12 +00:00
float fSuspensionAntidiveMultiplier;
2019-06-19 21:41:43 +00:00
float fCollisionDamageMultiplier;
uint32 Flags;
float fSeatOffsetDistance;
int32 nMonetaryValue;
int8 FrontLights;
int8 RearLights;
};
2020-05-19 11:07:12 +00:00
struct tBikeHandlingData
{
2020-11-24 15:15:51 +00:00
tVehicleType nIdentifier;
2020-05-19 11:07:12 +00:00
float fLeanFwdCOM;
float fLeanFwdForce;
float fLeanBakCOM;
float fLeanBackForce;
float fMaxLean;
float fFullAnimLean;
float fDesLean;
float fSpeedSteer;
float fSlipSteer;
float fNoPlayerCOMz;
float fWheelieAng;
float fStoppieAng;
float fWheelieSteer;
float fWheelieStabMult;
float fStoppieStabMult;
};
struct tBoatHandlingData
{
2020-11-24 15:15:51 +00:00
tVehicleType nIdentifier;
2020-05-19 11:07:12 +00:00
float fThrustY;
float fThrustZ;
float fThrustAppZ;
float fAqPlaneForce;
float fAqPlaneLimit;
float fAqPlaneOffset;
float fWaveAudioMult;
float fLook_L_R_BehindCamHeight;
CVector vecMoveRes;
CVector vecTurnRes;
};
struct tFlyingHandlingData
{
2020-11-24 15:15:51 +00:00
tVehicleType nIdentifier;
2020-05-19 11:07:12 +00:00
float fThrust;
float fThrustFallOff;
float fYaw;
float fYawStab;
float fSideSlip;
float fRoll;
float fRollStab;
float fPitch;
float fPitchStab;
float fFormLift;
float fAttackLift;
float fMoveRes;
CVector vecTurnRes;
CVector vecSpeedRes;
};
2019-06-19 21:41:43 +00:00
class CVehicle;
2019-06-17 08:30:02 +00:00
class cHandlingDataMgr
{
2019-06-19 21:41:43 +00:00
float field_0; // unused it seems
2019-07-10 09:05:49 +00:00
public:
2020-05-19 11:09:20 +00:00
float fWheelFriction; // wheel related
2019-07-10 09:05:49 +00:00
private:
2019-06-19 21:41:43 +00:00
float field_8; //
float field_C; // unused it seems
float field_10; //
tHandlingData HandlingData[NUMHANDLINGS];
2020-05-19 11:07:12 +00:00
tBikeHandlingData BikeHandlingData[NUMBIKEHANDLINGS];
tFlyingHandlingData FlyingHandlingData[NUMFLYINGHANDLINGS];
tBoatHandlingData BoatHandlingData[NUMBOATHANDLINGS];
2019-06-19 21:41:43 +00:00
2019-06-17 08:30:02 +00:00
public:
2019-06-19 21:41:43 +00:00
cHandlingDataMgr(void);
void Initialise(void);
void LoadHandlingData(void);
int FindExactWord(const char *word, const char *words, int wordLen, int numWords);
void ConvertDataToWorldUnits(tHandlingData *handling);
2019-06-19 21:41:43 +00:00
void ConvertDataToGameUnits(tHandlingData *handling);
2020-05-19 11:07:12 +00:00
void ConvertBikeDataToGameUnits(tBikeHandlingData *handling);
2019-06-17 08:30:02 +00:00
int32 GetHandlingId(const char *name);
2020-11-24 15:15:51 +00:00
tHandlingData *GetHandlingData(tVehicleType id) { return &HandlingData[id]; }
2020-05-19 11:07:12 +00:00
tBikeHandlingData *GetBikePointer(uint8 id) { return &BikeHandlingData[id-HANDLING_BIKE]; }
tFlyingHandlingData *GetFlyingPointer(uint8 id);
tBoatHandlingData *GetBoatPointer(uint8 id);
2020-11-24 15:15:51 +00:00
bool HasRearWheelDrive(tVehicleType id) { return HandlingData[id].Transmission.nDriveType == 'R'; }
bool HasFrontWheelDrive(tVehicleType id) { return HandlingData[id].Transmission.nDriveType == 'F'; }
2019-06-17 08:30:02 +00:00
};
2020-04-16 12:30:47 +00:00
extern cHandlingDataMgr mod_HandlingManager;