2023-08-25 21:37:13 +00:00
|
|
|
/** The state the NSMoverEntity is in. */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
MOVER_POS1, /**< At the initial starting position. */
|
|
|
|
MOVER_POS2, /**< At the final destination. */
|
|
|
|
MOVER_1TO2, /**< On its way to the final destination. */
|
|
|
|
MOVER_2TO1 /**< on its way back to the starting position. */
|
|
|
|
} moverState_t;
|
|
|
|
|
|
|
|
/** The movement type of the NSMoverEntity. */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
MOVERTYPE_LINEAR, /**< Moves in a linear fashion. */
|
|
|
|
MOVERTYPE_ACCELERATED, /**< Moved in an accelerated fashion. */
|
|
|
|
} moverType_t;
|
|
|
|
|
2023-11-27 06:24:08 +00:00
|
|
|
/* fields used by ncMover */
|
|
|
|
.float wait;
|
|
|
|
.float lip;
|
|
|
|
.float speed;
|
|
|
|
|
|
|
|
class ncMover:ncEntity
|
2023-08-25 21:37:13 +00:00
|
|
|
{
|
|
|
|
public:
|
2023-11-27 06:24:08 +00:00
|
|
|
void ncMover(void);
|
2023-08-25 21:37:13 +00:00
|
|
|
|
|
|
|
/** Returns a directional position from the current one. */
|
|
|
|
nonvirtual vector GetDirectionalPosition(vector, float);
|
|
|
|
/** Returns a directional angle from the current one. */
|
|
|
|
nonvirtual vector GetDirectionalRotation(vector, float);
|
|
|
|
|
|
|
|
/** Set the movement state. */
|
|
|
|
nonvirtual void SetMoverState(moverState_t);
|
|
|
|
/** Returns the movement state. */
|
|
|
|
nonvirtual moverState_t GetMoverState(void);
|
|
|
|
|
|
|
|
/** Set the movement type. */
|
|
|
|
nonvirtual void SetMoverType(moverType_t);
|
|
|
|
/** Returns the movement type. */
|
|
|
|
nonvirtual moverType_t GetMoverType(void);
|
|
|
|
|
|
|
|
/** Sets the initial starting position. */
|
|
|
|
nonvirtual void SetMoverPosition1(vector);
|
|
|
|
/** Returns the starting position. */
|
|
|
|
nonvirtual vector GetMoverPosition1(void);
|
|
|
|
|
|
|
|
/** Sets the final destination. */
|
|
|
|
nonvirtual void SetMoverPosition2(vector);
|
|
|
|
/** Returns the final destination. */
|
|
|
|
nonvirtual vector GetMoverPosition2(void);
|
|
|
|
|
|
|
|
/** Sets the initial starting angle. */
|
|
|
|
nonvirtual void SetMoverRotation1(vector);
|
|
|
|
/** Returns the starting angle. */
|
|
|
|
nonvirtual vector GetMoverRotation1(void);
|
|
|
|
|
|
|
|
/** Sets the final destination angle. */
|
|
|
|
nonvirtual void SetMoverRotation2(vector);
|
|
|
|
/** Returns the final destination angle. */
|
|
|
|
nonvirtual vector GetMoverRotation2(void);
|
|
|
|
|
|
|
|
/** Moves this entity to the specified position. */
|
|
|
|
nonvirtual void MoveToPosition(vector, float);
|
|
|
|
/** Rotates this entity to the desired angle. */
|
|
|
|
nonvirtual void RotateToPosition(vector, float);
|
|
|
|
/** Moves and rotates this entity to a desired location. */
|
|
|
|
nonvirtual void MoveAndRotateToPosition(vector, vector, float);
|
|
|
|
|
|
|
|
/** Moves to the reverse state. If a mover is at pos1, it'll go to pos2, etc. */
|
|
|
|
nonvirtual void MoveToReverse(float);
|
|
|
|
/** Rotates to the reversed state. */
|
|
|
|
nonvirtual void RotateToReverse(float);
|
|
|
|
/** Returns if the NSMoverEntity is currently moving. */
|
|
|
|
nonvirtual bool IsMoving(void);
|
|
|
|
|
2023-11-27 06:24:08 +00:00
|
|
|
/** Returns the 'lip', the amount the brush sticks out/overlaps in units. */
|
|
|
|
nonvirtual float GetLip(void);
|
|
|
|
/** Returns the speed the brush moves at in units per second. */
|
|
|
|
nonvirtual float GetSpeed(void);
|
|
|
|
/** Returns the time in seconds until the mover returns to its default position. */
|
|
|
|
nonvirtual float GetWaitTime(void);
|
|
|
|
|
2023-08-25 21:37:13 +00:00
|
|
|
/** Overridable: Called when the mover starts moving from its position to another. */
|
|
|
|
virtual void MoverStartsMoving(void);
|
|
|
|
/** Overridable: Called when the mover completes its movement to a destination. */
|
|
|
|
virtual void MoverFinishesMoving(void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
nonvirtual void _ArrivedAtRotPosition1(void);
|
|
|
|
nonvirtual void _ArrivedAtRotPosition2(void);
|
|
|
|
nonvirtual void _BeginMoving(void);
|
|
|
|
};
|
|
|
|
|
|
|
|
.vector m_vecPos1;
|
|
|
|
.vector m_vecPos2;
|
|
|
|
.vector m_vecPos3;
|
|
|
|
.vector m_vecPos4;
|
|
|
|
.moverState_t m_moverState;
|
|
|
|
.moverType_t m_moverType;
|