1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
#ifndef SCRIPT_MOVE_TYPE_H
#define SCRIPT_MOVE_TYPE_H
#include "MoveType.h"
class CScriptMoveType : public AMoveType
{
CR_DECLARE(CScriptMoveType);
public:
CScriptMoveType(CUnit* owner);
virtual ~CScriptMoveType(void);
public:
void Update();
void SlowUpdate();
void ForceUpdates();
void SetPhysics(const float3& pos, const float3& vel, const float3& rot);
void SetPosition(const float3& pos);
void SetVelocity(const float3& vel);
void SetRelativeVelocity(const float3& rvel);
void SetRotation(const float3& rot);
void SetRotationVelocity(const float3& rvel);
void SetRotationOffset(const float3& rotOff);
void SetHeading(short heading);
void SetNoBlocking(bool state);
public: // null'ed virtuals
void StartMoving(float3, float goalRadius) {};
void StartMoving(float3, float goalRadius, float speed) {};
void KeepPointingTo(float3, float distance, bool aggressive) {};
void KeepPointingTo(CUnit* unit, float distance, bool aggressive) {};
void StopMoving() {};
void Idle(unsigned int frames) {};
void Idle() {};
void DeIdle() {};
void ImpulseAdded() {};
void SetGoal(float3 pos) {};
void SetMaxSpeed(float speed) {};
void SetWantedMaxSpeed(float speed) {};
void LeaveTransport(void) {};
protected:
void CalcDirections();
void TrackSlope();
void CheckLimits();
void CheckNotify();
public:
int tag;
bool extrapolate;
float drag;
/// velocity
float3 vel;
/// relative velocity (to current direction)
float3 relVel;
bool useRelVel;
/// angular position
float3 rot;
/// angular velocity
float3 rotVel;
bool useRotVel;
bool trackSlope;
bool trackGround;
float groundOffset;
float gravityFactor;
float windFactor;
float3 mins;
float3 maxs;
bool noBlocking;
bool gndStop;
bool shotStop;
bool slopeStop;
bool collideStop;
bool leaveTracks;
protected:
bool hasDecal;
bool isBuilding;
bool isBlocking;
float3 rotOffset;
int lastTrackUpdate;
float3 oldPos;
float3 oldSlowUpdatePos;
int scriptNotify;
};
#endif // SCRIPT_MOVE_TYPE_H
|