Nuclide
Software Development Kit for id Technology
NSMoverEntity Class Reference

About this class

NSMoverEntity is responsible for handling movement functions of mainly brush-based entities that move and push other entities around the game world.

Your sub-class will define the type of movement and the two positions within the entity will traverse - and then do so at your request.

Inheritance diagram for NSMoverEntity:
NSSurfacePropEntity func_button func_door func_door_rotating func_plat func_platrot func_trackchange func_trackautochange

Public Member Functions

void NSMoverEntity (void)
 
nonvirtual vector GetDirectionalPosition (vector, float)
 Returns a directional position from the current one. More...
 
nonvirtual vector GetDirectionalRotation (vector, float)
 Returns a directional angle from the current one. More...
 
nonvirtual void SetMoverState (moverState_t)
 Set the movement state. More...
 
nonvirtual moverState_t GetMoverState (void)
 Returns the movement state. More...
 
nonvirtual void SetMoverType (moverType_t)
 Set the movement type. More...
 
nonvirtual moverType_t GetMoverType (void)
 Returns the movement type. More...
 
nonvirtual void SetMoverPosition1 (vector)
 Sets the initial starting position. More...
 
nonvirtual vector GetMoverPosition1 (void)
 Returns the starting position. More...
 
nonvirtual void SetMoverPosition2 (vector)
 Sets the final destination. More...
 
nonvirtual vector GetMoverPosition2 (void)
 Returns the final destination. More...
 
nonvirtual void SetMoverRotation1 (vector)
 Sets the initial starting angle. More...
 
nonvirtual vector GetMoverRotation1 (void)
 Returns the starting angle. More...
 
nonvirtual void SetMoverRotation2 (vector)
 Sets the final destination angle. More...
 
nonvirtual vector GetMoverRotation2 (void)
 Returns the final destination angle. More...
 
nonvirtual void MoveToPosition (vector, float)
 Moves this entity to the specified position. More...
 
nonvirtual void RotateToPosition (vector, float)
 Rotates this entity to the desired angle. More...
 
nonvirtual void MoveAndRotateToPosition (vector, vector, float)
 Moves and rotates this entity to a desired location. More...
 
nonvirtual void MoveToReverse (float)
 Moves to the reverse state. More...
 
nonvirtual void RotateToReverse (float)
 Rotates to the reversed state. More...
 
nonvirtual bool IsMoving (void)
 Returns if the NSMoverEntity is currently moving. More...
 
virtual void MoverStartsMoving (void)
 Overridable: Called when the mover starts moving from its position to another. More...
 
virtual void MoverFinishesMoving (void)
 Overridable: Called when the mover completes its movement to a destination. More...
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to NSIO::SpawnKey but for save-game fields. More...
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 

Constructor & Destructor Documentation

◆ NSMoverEntity()

void NSMoverEntity::NSMoverEntity ( void  )

Member Function Documentation

◆ GetDirectionalPosition()

vector NSMoverEntity::GetDirectionalPosition ( vector  vecAngle,
float  flLip 
)

Returns a directional position from the current one.

◆ GetDirectionalRotation()

vector NSMoverEntity::GetDirectionalRotation ( vector  normalizedAngle,
float  travelDistance 
)

Returns a directional angle from the current one.

◆ GetMoverPosition1()

vector NSMoverEntity::GetMoverPosition1 ( void  )

Returns the starting position.

◆ GetMoverPosition2()

vector NSMoverEntity::GetMoverPosition2 ( void  )

Returns the final destination.

◆ GetMoverRotation1()

vector NSMoverEntity::GetMoverRotation1 ( void  )

Returns the starting angle.

◆ GetMoverRotation2()

vector NSMoverEntity::GetMoverRotation2 ( void  )

Returns the final destination angle.

◆ GetMoverState()

moverState_t NSMoverEntity::GetMoverState ( void  )

Returns the movement state.

◆ GetMoverType()

moverType_t NSMoverEntity::GetMoverType ( void  )

Returns the movement type.

◆ IsMoving()

bool NSMoverEntity::IsMoving ( void  )

Returns if the NSMoverEntity is currently moving.

◆ MoveAndRotateToPosition()

void NSMoverEntity::MoveAndRotateToPosition ( vector  vecDest,
vector  vecAngle,
float  flSpeed 
)

Moves and rotates this entity to a desired location.

◆ MoverFinishesMoving()

void NSMoverEntity::MoverFinishesMoving ( void  )
virtual

Overridable: Called when the mover completes its movement to a destination.

Reimplemented in func_button, func_door, func_door_rotating, func_plat, and func_trackchange.

◆ MoverStartsMoving()

void NSMoverEntity::MoverStartsMoving ( void  )
virtual

Overridable: Called when the mover starts moving from its position to another.

Reimplemented in func_button, func_door, func_door_rotating, func_plat, and func_trackchange.

◆ MoveToPosition()

void NSMoverEntity::MoveToPosition ( vector  vecDest,
float  flSpeed 
)

Moves this entity to the specified position.

◆ MoveToReverse()

void NSMoverEntity::MoveToReverse ( float  flSpeed)

Moves to the reverse state.

If a mover is at pos1, it'll go to pos2, etc.

◆ Restore()

void NSMoverEntity::Restore ( string  strKey,
string  strValue 
)
virtual

Similar to NSIO::SpawnKey but for save-game fields.

Whatever you write into file handles within your NSIO::Save() method needs to be read back in here.

Reimplemented from NSSurfacePropEntity.

Reimplemented in func_button, func_door, func_door_rotating, func_plat, func_platrot, and func_trackchange.

◆ RotateToPosition()

void NSMoverEntity::RotateToPosition ( vector  vecAngle,
float  flSpeed 
)

Rotates this entity to the desired angle.

◆ RotateToReverse()

void NSMoverEntity::RotateToReverse ( float  flSpeed)

Rotates to the reversed state.

◆ Save()

void NSMoverEntity::Save ( float  handle)
virtual

Handles saving a copy of this entity to a given filehandle.

Within you want to use the NSIO::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.

Reimplemented from NSSurfacePropEntity.

Reimplemented in func_button, func_door, func_door_rotating, func_plat, func_platrot, and func_trackchange.

◆ SetMoverPosition1()

void NSMoverEntity::SetMoverPosition1 ( vector  val)

Sets the initial starting position.

◆ SetMoverPosition2()

void NSMoverEntity::SetMoverPosition2 ( vector  val)

Sets the final destination.

◆ SetMoverRotation1()

void NSMoverEntity::SetMoverRotation1 ( vector  val)

Sets the initial starting angle.

◆ SetMoverRotation2()

void NSMoverEntity::SetMoverRotation2 ( vector  val)

Sets the final destination angle.

◆ SetMoverState()

void NSMoverEntity::SetMoverState ( moverState_t  val)

Set the movement state.

◆ SetMoverType()

void NSMoverEntity::SetMoverType ( moverType_t  val)

Set the movement type.

◆ SpawnKey()

void NSMoverEntity::SpawnKey ( string  strKey,
string  strValue 
)
virtual

This method handles entity key/value pairs on map load.

You can easily convert the strValue parameter using the ReadFloat etc. methods that are part of NSIO.

Reimplemented from NSSurfacePropEntity.

Reimplemented in func_button, func_door, func_door_rotating, func_plat, func_platrot, and func_trackchange.


The documentation for this class was generated from the following files: