re3/src/vehicles/Plane.h

82 lines
1.8 KiB
C
Raw Normal View History

2019-06-02 17:13:56 +02:00
#pragma once
#include "Vehicle.h"
enum ePlaneNodes
{
2020-07-21 09:58:53 +02:00
#ifdef CPLANE_ROTORS
// for heli
PLANE_TOPROTOR,
PLANE_BACKROTOR,
#endif
PLANE_WHEEL_FRONT = 2,
PLANE_WHEEL_READ,
NUM_PLANE_NODES
};
2019-07-31 23:57:18 +02: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 17:13:56 +02:00
class CPlane : public CVehicle
{
public:
2020-07-21 09:58:53 +02:00
#ifdef CPLANE_ROTORS
RwFrame *m_aPlaneNodes[NUM_PLANE_NODES];
float m_fRotorRotation;
#endif
2019-07-31 23:57:18 +02: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-19 00:37:44 +02:00
bool m_bTempPlane;
2019-07-31 23:57:18 +02:00
CPlane(int32 id, uint8 CreatedBy);
~CPlane(void);
2019-07-31 23:57:18 +02:00
// from CEntity
void SetModelIndex(uint32 id);
void DeleteRwObject(void);
void ProcessControl(void);
void PreRender(void);
void Render(void);
void FlagToDestroyWhenNextProcessed() { bRemoveFromWorld = true; }
2019-07-31 23:57:18 +02:00
static void InitPlanes(void);
static void Shutdown(void);
static CPlaneNode *LoadPath(char const *filename, int32 &numNodes, float &totalLength, bool loop);
2020-07-19 00:37:44 +02:00
static void RemoveTemporaryPlanes(void);
2019-07-31 23:57:18 +02:00
static void UpdatePlanes(void);
static bool TestRocketCollision(CVector *rocketPos);
static void CreateIncomingCesna(void);
static void CreateDropOffCesna(void);
2020-01-23 16:43:19 +01:00
static const CVector FindDrugPlaneCoordinates(void);
static const CVector FindDropOffCesnaCoordinates(void);
2019-07-31 23:57:18 +02:00
static bool HasCesnaLanded(void);
static bool HasCesnaBeenDestroyed(void);
static bool HasDropOffCesnaBeenShotDown(void);
2020-07-19 00:37:44 +02:00
static void Load(void);
static void Save(void);
2019-06-02 17:13:56 +02:00
};
2019-07-31 23:57:18 +02:00
2020-04-16 14:30:47 +02:00
extern float LandingPoint;
extern float TakeOffPoint;
extern float PlanePathPosition[3];