2019-06-02 15:13:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Vehicle.h"
|
|
|
|
|
2020-05-10 18:51:29 +00:00
|
|
|
enum ePlaneNodes
|
|
|
|
{
|
2020-07-21 07:58:53 +00:00
|
|
|
#ifdef CPLANE_ROTORS
|
|
|
|
// for heli
|
|
|
|
PLANE_TOPROTOR,
|
|
|
|
PLANE_BACKROTOR,
|
|
|
|
#endif
|
2020-05-10 18:51:29 +00:00
|
|
|
PLANE_WHEEL_FRONT = 2,
|
|
|
|
PLANE_WHEEL_READ,
|
|
|
|
NUM_PLANE_NODES
|
|
|
|
};
|
|
|
|
|
2019-07-31 21:57:18 +00:00
|
|
|
struct CPlaneNode
|
|
|
|
{
|
|
|
|
CVector p; // position
|
|
|
|
float t; // xy-distance from start on path
|
|
|
|
bool bOnGround; // i.e. not flying
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CPlaneInterpolationLine
|
|
|
|
{
|
|
|
|
uint8 type;
|
|
|
|
float time; // when does this keyframe start
|
|
|
|
// initial values at start of frame
|
|
|
|
float position;
|
|
|
|
float speed;
|
|
|
|
float acceleration;
|
|
|
|
};
|
|
|
|
|
2019-06-02 15:13:56 +00:00
|
|
|
class CPlane : public CVehicle
|
|
|
|
{
|
|
|
|
public:
|
2020-07-21 07:58:53 +00:00
|
|
|
#ifdef CPLANE_ROTORS
|
|
|
|
RwFrame *m_aPlaneNodes[NUM_PLANE_NODES];
|
|
|
|
float m_fRotorRotation;
|
|
|
|
#endif
|
2019-07-31 21:57:18 +00:00
|
|
|
int16 m_nPlaneId;
|
|
|
|
int16 m_isFarAway;
|
|
|
|
int16 m_nCurPathNode;
|
|
|
|
float m_fSpeed;
|
|
|
|
uint32 m_nFrameWhenHit;
|
|
|
|
bool m_bHasBeenHit;
|
|
|
|
bool m_bIsDrugRunCesna;
|
|
|
|
bool m_bIsDropOffCesna;
|
2020-07-18 22:37:44 +00:00
|
|
|
bool m_bTempPlane;
|
2019-07-31 21:57:18 +00:00
|
|
|
|
|
|
|
CPlane(int32 id, uint8 CreatedBy);
|
2019-06-30 10:59:55 +00:00
|
|
|
~CPlane(void);
|
2019-07-31 21:57:18 +00:00
|
|
|
|
|
|
|
// from CEntity
|
|
|
|
void SetModelIndex(uint32 id);
|
|
|
|
void DeleteRwObject(void);
|
|
|
|
void ProcessControl(void);
|
|
|
|
void PreRender(void);
|
|
|
|
void Render(void);
|
2019-06-30 10:59:55 +00:00
|
|
|
void FlagToDestroyWhenNextProcessed() { bRemoveFromWorld = true; }
|
2019-07-31 21:57:18 +00:00
|
|
|
|
|
|
|
static void InitPlanes(void);
|
|
|
|
static void Shutdown(void);
|
|
|
|
static CPlaneNode *LoadPath(char const *filename, int32 &numNodes, float &totalLength, bool loop);
|
2020-07-18 22:37:44 +00:00
|
|
|
static void RemoveTemporaryPlanes(void);
|
2019-07-31 21:57:18 +00:00
|
|
|
static void UpdatePlanes(void);
|
|
|
|
static bool TestRocketCollision(CVector *rocketPos);
|
|
|
|
static void CreateIncomingCesna(void);
|
|
|
|
static void CreateDropOffCesna(void);
|
2020-01-23 15:43:19 +00:00
|
|
|
static const CVector FindDrugPlaneCoordinates(void);
|
|
|
|
static const CVector FindDropOffCesnaCoordinates(void);
|
2019-07-31 21:57:18 +00:00
|
|
|
static bool HasCesnaLanded(void);
|
|
|
|
static bool HasCesnaBeenDestroyed(void);
|
|
|
|
static bool HasDropOffCesnaBeenShotDown(void);
|
2020-07-18 22:37:44 +00:00
|
|
|
static void Load(void);
|
|
|
|
static void Save(void);
|
2019-06-02 15:13:56 +00:00
|
|
|
};
|
2019-07-31 21:57:18 +00:00
|
|
|
|
2020-04-16 12:30:47 +00:00
|
|
|
extern float LandingPoint;
|
|
|
|
extern float TakeOffPoint;
|
|
|
|
extern float PlanePathPosition[3];
|