OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
TeleportPoint Class Reference

#include <TeleportPoint.h>

Public Member Functions

bool isValid ()
 
void invalidate ()
 
void setTeleportTarget (Vec3f pos, int yaw, int pitch, int zSpeed)
 
void setTeleportMap (std::string_view mapName)
 
const std::string & getTeleportMap ()
 
void doTeleport (bool keepOnZero)
 

Private Attributes

bool _teleportValid = false
 
std::string _targetMap
 
Vec3f _pos
 
int _yaw = 0
 
int _pitch = 0
 
int _zSpeed = 0
 

Detailed Description

Describes target teleportation point of the party.

Member Function Documentation

◆ doTeleport()

void TeleportPoint::doTeleport ( bool  keepOnZero)

Perform teleportation using current valid point. Changes effective party position, speed and camera position. Target map is not used.

Parameters
keepOnZeroDo not change speed/positions if corresponding parameter is set to 0. Does not affect yaw - it never updated if set to -1, and updated on any other value.

◆ getTeleportMap()

const std::string & TeleportPoint::getTeleportMap ( )
inline

Get target map name.

◆ invalidate()

void TeleportPoint::invalidate ( )

Mark teleporation point as invalid. Invalid points cannot be used for teleportation.

◆ isValid()

bool TeleportPoint::isValid ( )
inline

Checks validity of teleportation point

◆ setTeleportMap()

void TeleportPoint::setTeleportMap ( std::string_view  mapName)
inline

Set target map name for teleportation. Map name is not used by doTeleport function because map loading processing is required in this case. It is used separately in game message processing instead to change current map to previosly prepared one.

Parameters
mapNameName of the target map.

◆ setTeleportTarget()

void TeleportPoint::setTeleportTarget ( Vec3f  pos,
int  yaw,
int  pitch,
int  zSpeed 
)

Set teleportation target within the map. Updates teleportation point validity if any of the set values is not zero (or -1 for yaw).

Parameters
posParty position after teleportation.
yawCamera yaw after teleportation, if set to -1 then yaw will not be changed after teleport.
pitchCamera pitch after teleportation.
zSpeedVertical velocity of party after teleportation.

Member Data Documentation

◆ _pitch

int TeleportPoint::_pitch = 0
private

◆ _pos

Vec3f TeleportPoint::_pos
private

◆ _targetMap

std::string TeleportPoint::_targetMap
private

◆ _teleportValid

bool TeleportPoint::_teleportValid = false
private

◆ _yaw

int TeleportPoint::_yaw = 0
private

◆ _zSpeed

int TeleportPoint::_zSpeed = 0
private

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