// ### OpenGTA3 ###
// handling object
// TODO: возможно, стоит это загнать в ogConfig.h

#pragma pack(push,1)
#define VEHICLE_COUNT	210
#define BIKE_COUNT		13
#define	FLYING_COUNT	24
#define	BOAT_COUNT		12

struct TransmissionData {
	DWORD	_f00;
	DWORD	_f04;
	DWORD	_f08;
	DWORD	_f0C;
	DWORD	_f10;
	DWORD	_f14;
	DWORD	_f18;
	DWORD	_f1C;
	DWORD	_f20;
	DWORD	_f24;
	DWORD	_f28;
	DWORD	_f2C;
	DWORD	_f30;
	DWORD	_f34;
	DWORD	_f38;
	DWORD	_f3C;
	DWORD	_f40;
	DWORD	_f44;
	BYTE	nDriveType;
	BYTE	nEngineType;
	BYTE	nNumberOfGears;
	BYTE	_f4B;
	DWORD	_f4C;
	float	fEngineAcceleration;
	float	fEngineInertia;
	float	fMaxVelocity;
	DWORD	_f5C;
	DWORD	_f60;
};

struct HandlingVehicle {
	int			index;
	float		fMass;
	float		_f8;	// 1.0/fMass
	float		fTurnMass;
	float		fDragMult;
	D3DVECTOR	centreOfMass;
	BYTE		nPercentSubmerged;
	BYTE		_f21;
	BYTE		_f22;
	BYTE		_f23;
	DWORD		_f24;
	float		fTractionMultiplier;
	TransmissionData	transmissionData;
	DWORD		_f90;
	float		fBrakeDeceleration;
	float		fBrakeBias;
	BYTE		bABS;
	BYTE		_f9D;
	BYTE		_f9E;
	BYTE		_f9F;
	float		fSteeringLock;
	float		fTractionLoss;
	float		fTractionBias;
	float		fSuspensionForceLevel;
	float		fSuspensionDampingLevel;
	float		fSuspensionHighSpdComDamp;
	float		fSuspensionUpperLimit;
	float		fSuspensionLowerLimit;
	float		fSuspensionBiasBetweenFrontAndRear;
	float		fSuspensionAntiDiveMultiplier;
	float		fCollisionDamageMultiplier;
	DWORD		modelFlags;
	DWORD		handlingFlags;
	float		fSeatOffsetDistance;
	int			nMonetaryValue;
	BYTE		frontLight;
	BYTE		rearLight;
	BYTE		animGroup;
	BYTE		_fDF;
};

struct HandlingBike {
	int		index;
	float	leanFwdCOM;
	float	leanFwdForce;
	float	leanBakCOM;
	float	leanBakForce;
	float	maxLean;
	float	fullAnimLean;
	float	desLean;
	float	speedSteer;
	float	slipSteer;
	float	noPlayerCOMz;
	float	wheelieAng;
	float	stoppieAng;
	float	wheelieSteer;
	float	wheelieStabMult;
	float	stoppieStabMult;
};

struct HandlingFlying {
	int			index;
	float		thrust;
	float		thrustFallOff;
	float		yaw;
	float		yawStab;
	float		sideSlip;
	float		roll;
	float		rollStab;
	float		pitch;
	float		pitchStab;
	float		formLift;
	float		attackLift;
	float		gearUpR;
	float		gearDownL;
	float		windMult;
	float		moveRes;
	D3DVECTOR	turnRes;
	D3DVECTOR	speedRes;
};

struct HandlingBoat {
	int			index;
	float		thrustY;
	float		thrustZ;
	float		thrustAppZ;
	float		aqPlaneForce;
	float		aqPlaneLimit;
	float		aqPlaneOffset;
	float		waveAudioMiult;
	float		look_L_R_BehindCamHeight;
	D3DVECTOR	moveRes;
	D3DVECTOR	turnRes;
};

struct CHandling {
	DWORD	_f00;
	DWORD	_f04;
	DWORD	_f08;
	DWORD	_f0C;
	DWORD	_f10;
	HandlingVehicle	vehicleHandling[VEHICLE_COUNT];
	HandlingBike	bikeHandling[BIKE_COUNT];
	HandlingFlying	flyingHandling[FLYING_COUNT];
	HandlingBoat	boatHandling[BOAT_COUNT];
};

extern CHandling * handling;
#pragma pack(pop)