Nuclide
Software Development Kit for id Technology
|
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.
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... | |
void NSMoverEntity::NSMoverEntity | ( | void | ) |
vector NSMoverEntity::GetDirectionalPosition | ( | vector | vecAngle, |
float | flLip | ||
) |
Returns a directional position from the current one.
vector NSMoverEntity::GetDirectionalRotation | ( | vector | normalizedAngle, |
float | travelDistance | ||
) |
Returns a directional angle from the current one.
vector NSMoverEntity::GetMoverPosition1 | ( | void | ) |
Returns the starting position.
vector NSMoverEntity::GetMoverPosition2 | ( | void | ) |
Returns the final destination.
vector NSMoverEntity::GetMoverRotation1 | ( | void | ) |
Returns the starting angle.
vector NSMoverEntity::GetMoverRotation2 | ( | void | ) |
Returns the final destination angle.
moverState_t NSMoverEntity::GetMoverState | ( | void | ) |
Returns the movement state.
moverType_t NSMoverEntity::GetMoverType | ( | void | ) |
Returns the movement type.
bool NSMoverEntity::IsMoving | ( | void | ) |
Returns if the NSMoverEntity is currently moving.
void NSMoverEntity::MoveAndRotateToPosition | ( | vector | vecDest, |
vector | vecAngle, | ||
float | flSpeed | ||
) |
Moves and rotates this entity to a desired location.
|
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.
|
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.
void NSMoverEntity::MoveToPosition | ( | vector | vecDest, |
float | flSpeed | ||
) |
Moves this entity to the specified position.
void NSMoverEntity::MoveToReverse | ( | float | flSpeed | ) |
Moves to the reverse state.
If a mover is at pos1, it'll go to pos2, etc.
|
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.
void NSMoverEntity::RotateToPosition | ( | vector | vecAngle, |
float | flSpeed | ||
) |
Rotates this entity to the desired angle.
void NSMoverEntity::RotateToReverse | ( | float | flSpeed | ) |
Rotates to the reversed state.
|
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.
void NSMoverEntity::SetMoverPosition1 | ( | vector | val | ) |
Sets the initial starting position.
void NSMoverEntity::SetMoverPosition2 | ( | vector | val | ) |
Sets the final destination.
void NSMoverEntity::SetMoverRotation1 | ( | vector | val | ) |
Sets the initial starting angle.
void NSMoverEntity::SetMoverRotation2 | ( | vector | val | ) |
Sets the final destination angle.
void NSMoverEntity::SetMoverState | ( | moverState_t | val | ) |
Set the movement state.
void NSMoverEntity::SetMoverType | ( | moverType_t | val | ) |
Set the movement type.
|
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.