TrinityCore
Loading...
Searching...
No Matches
Position Struct Reference

#include <Position.h>

+ Inheritance diagram for Position:

Classes

struct  ConstStreamer
 
struct  Streamer
 

Public Member Functions

 Position ()
 
 Position (float x, float y, float z=0.0f, float o=0.0f)
 
bool operator== (Position const &a) const
 
void Relocate (float x, float y)
 
void Relocate (float x, float y, float z)
 
void Relocate (float x, float y, float z, float o)
 
void Relocate (Position const &pos)
 
void Relocate (Position const *pos)
 
void RelocateOffset (Position const &offset)
 
void SetOrientation (float orientation)
 
float GetPositionX () const
 
float GetPositionY () const
 
float GetPositionZ () const
 
float GetOrientation () const
 
void GetPosition (float &x, float &y) const
 
void GetPosition (float &x, float &y, float &z) const
 
void GetPosition (float &x, float &y, float &z, float &o) const
 
Position GetPosition () const
 
Streamer< XY > PositionXYStream ()
 
ConstStreamer< XY > PositionXYStream () const
 
Streamer< XYZ > PositionXYZStream ()
 
ConstStreamer< XYZ > PositionXYZStream () const
 
Streamer< XYZO > PositionXYZOStream ()
 
ConstStreamer< XYZO > PositionXYZOStream () const
 
Streamer< PackedXYZ > PositionPackedXYZStream ()
 
ConstStreamer< PackedXYZ > PositionPackedXYZStream () const
 
bool IsPositionValid () const
 
float GetExactDist2dSq (const float x, const float y) const
 
float GetExactDist2dSq (Position const &pos) const
 
float GetExactDist2dSq (Position const *pos) const
 
float GetExactDist2d (const float x, const float y) const
 
float GetExactDist2d (Position const &pos) const
 
float GetExactDist2d (Position const *pos) const
 
float GetExactDistSq (float x, float y, float z) const
 
float GetExactDistSq (Position const &pos) const
 
float GetExactDistSq (Position const *pos) const
 
float GetExactDist (float x, float y, float z) const
 
float GetExactDist (Position const &pos) const
 
float GetExactDist (Position const *pos) const
 
void GetPositionOffsetTo (Position const &endPos, Position &retOffset) const
 
Position GetPositionWithOffset (Position const &offset) const
 
float GetAbsoluteAngle (float x, float y) const
 
float GetAbsoluteAngle (Position const &pos) const
 
float GetAbsoluteAngle (Position const *pos) const
 
float ToAbsoluteAngle (float relAngle) const
 
float ToRelativeAngle (float absAngle) const
 
float GetRelativeAngle (float x, float y) const
 
float GetRelativeAngle (Position const &pos) const
 
float GetRelativeAngle (Position const *pos) const
 
void GetSinCos (float x, float y, float &vsin, float &vcos) const
 
bool IsInDist2d (float x, float y, float dist) const
 
bool IsInDist2d (Position const *pos, float dist) const
 
bool IsInDist (float x, float y, float z, float dist) const
 
bool IsInDist (Position const &pos, float dist) const
 
bool IsInDist (Position const *pos, float dist) const
 
bool IsWithinBox (Position const &center, float xradius, float yradius, float zradius) const
 
bool IsWithinDoubleVerticalCylinder (Position const *center, float radius, float height) const
 
bool HasInArc (float arcangle, Position const *pos, float border=2.0f) const
 
bool HasInLine (Position const *pos, float objSize, float width) const
 
std::string ToString () const
 

Static Public Member Functions

static float NormalizeOrientation (float o)
 

Public Attributes

float m_positionX
 
float m_positionY
 
float m_positionZ
 

Private Attributes

float m_orientation
 

Detailed Description

Definition at line 27 of file Position.h.

Constructor & Destructor Documentation

◆ Position() [1/2]

Position::Position ( )
inline

Definition at line 29 of file Position.h.

+ Here is the caller graph for this function:

◆ Position() [2/2]

Position::Position ( float  x,
float  y,
float  z = 0.0f,
float  o = 0.0f 
)
inline

Definition at line 32 of file Position.h.

Member Function Documentation

◆ GetAbsoluteAngle() [1/3]

float Position::GetAbsoluteAngle ( float  x,
float  y 
) const
inline

Definition at line 128 of file Position.h.

+ Here is the caller graph for this function:

◆ GetAbsoluteAngle() [2/3]

float Position::GetAbsoluteAngle ( Position const &  pos) const
inline

Definition at line 134 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAbsoluteAngle() [3/3]

float Position::GetAbsoluteAngle ( Position const *  pos) const
inline

Definition at line 135 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetExactDist() [1/3]

float Position::GetExactDist ( float  x,
float  y,
float  z 
) const
inline

Definition at line 121 of file Position.h.

+ Here is the caller graph for this function:

◆ GetExactDist() [2/3]

float Position::GetExactDist ( Position const &  pos) const
inline

Definition at line 122 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetExactDist() [3/3]

float Position::GetExactDist ( Position const *  pos) const
inline

Definition at line 123 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetExactDist2d() [1/3]

float Position::GetExactDist2d ( const float  x,
const float  y 
) const
inline

Definition at line 109 of file Position.h.

+ Here is the caller graph for this function:

◆ GetExactDist2d() [2/3]

float Position::GetExactDist2d ( Position const &  pos) const
inline

Definition at line 110 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetExactDist2d() [3/3]

float Position::GetExactDist2d ( Position const *  pos) const
inline

Definition at line 111 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetExactDist2dSq() [1/3]

float Position::GetExactDist2dSq ( const float  x,
const float  y 
) const
inline

Definition at line 100 of file Position.h.

+ Here is the caller graph for this function:

◆ GetExactDist2dSq() [2/3]

float Position::GetExactDist2dSq ( Position const &  pos) const
inline

Definition at line 106 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetExactDist2dSq() [3/3]

float Position::GetExactDist2dSq ( Position const *  pos) const
inline

Definition at line 107 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetExactDistSq() [1/3]

float Position::GetExactDistSq ( float  x,
float  y,
float  z 
) const
inline

Definition at line 113 of file Position.h.

+ Here is the caller graph for this function:

◆ GetExactDistSq() [2/3]

float Position::GetExactDistSq ( Position const &  pos) const
inline

Definition at line 118 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetExactDistSq() [3/3]

float Position::GetExactDistSq ( Position const *  pos) const
inline

Definition at line 119 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetOrientation()

float Position::GetOrientation ( ) const
inline

Definition at line 82 of file Position.h.

◆ GetPosition() [1/4]

Position Position::GetPosition ( ) const
inline

Definition at line 87 of file Position.h.

+ Here is the caller graph for this function:

◆ GetPosition() [2/4]

void Position::GetPosition ( float &  x,
float &  y 
) const
inline

Definition at line 84 of file Position.h.

+ Here is the caller graph for this function:

◆ GetPosition() [3/4]

void Position::GetPosition ( float &  x,
float &  y,
float &  z 
) const
inline

Definition at line 85 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPosition() [4/4]

void Position::GetPosition ( float &  x,
float &  y,
float &  z,
float &  o 
) const
inline

Definition at line 86 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPositionOffsetTo()

void Position::GetPositionOffsetTo ( Position const &  endPos,
Position retOffset 
) const

Definition at line 49 of file Position.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPositionWithOffset()

Position Position::GetPositionWithOffset ( Position const &  offset) const

Definition at line 60 of file Position.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPositionX()

float Position::GetPositionX ( ) const
inline

Definition at line 79 of file Position.h.

◆ GetPositionY()

float Position::GetPositionY ( ) const
inline

Definition at line 80 of file Position.h.

◆ GetPositionZ()

float Position::GetPositionZ ( ) const
inline

Definition at line 81 of file Position.h.

◆ GetRelativeAngle() [1/3]

float Position::GetRelativeAngle ( float  x,
float  y 
) const
inline

Definition at line 139 of file Position.h.

+ Here is the caller graph for this function:

◆ GetRelativeAngle() [2/3]

float Position::GetRelativeAngle ( Position const &  pos) const
inline

Definition at line 140 of file Position.h.

◆ GetRelativeAngle() [3/3]

float Position::GetRelativeAngle ( Position const *  pos) const
inline

Definition at line 141 of file Position.h.

◆ GetSinCos()

void Position::GetSinCos ( float  x,
float  y,
float &  vsin,
float &  vcos 
) const

Definition at line 67 of file Position.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasInArc()

bool Position::HasInArc ( float  arcangle,
Position const *  pos,
float  border = 2.0f 
) const

Definition at line 120 of file Position.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasInLine()

bool Position::HasInLine ( Position const *  pos,
float  objSize,
float  width 
) const

Definition at line 139 of file Position.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsInDist() [1/3]

bool Position::IsInDist ( float  x,
float  y,
float  z,
float  dist 
) const
inline

Definition at line 148 of file Position.h.

+ Here is the caller graph for this function:

◆ IsInDist() [2/3]

bool Position::IsInDist ( Position const &  pos,
float  dist 
) const
inline

Definition at line 149 of file Position.h.

◆ IsInDist() [3/3]

bool Position::IsInDist ( Position const *  pos,
float  dist 
) const
inline

Definition at line 150 of file Position.h.

◆ IsInDist2d() [1/2]

bool Position::IsInDist2d ( float  x,
float  y,
float  dist 
) const
inline

Definition at line 145 of file Position.h.

+ Here is the caller graph for this function:

◆ IsInDist2d() [2/2]

bool Position::IsInDist2d ( Position const *  pos,
float  dist 
) const
inline

Definition at line 146 of file Position.h.

◆ IsPositionValid()

bool Position::IsPositionValid ( ) const

Definition at line 44 of file Position.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsWithinBox()

bool Position::IsWithinBox ( Position const &  center,
float  xradius,
float  yradius,
float  zradius 
) const

Definition at line 86 of file Position.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsWithinDoubleVerticalCylinder()

bool Position::IsWithinDoubleVerticalCylinder ( Position const *  center,
float  radius,
float  height 
) const

Definition at line 114 of file Position.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NormalizeOrientation()

float Position::NormalizeOrientation ( float  o)
static

Definition at line 156 of file Position.cpp.

+ Here is the caller graph for this function:

◆ operator==()

bool Position::operator== ( Position const &  a) const

Definition at line 28 of file Position.cpp.

◆ PositionPackedXYZStream() [1/2]

Streamer< PackedXYZ > Position::PositionPackedXYZStream ( )
inline

Definition at line 95 of file Position.h.

◆ PositionPackedXYZStream() [2/2]

ConstStreamer< PackedXYZ > Position::PositionPackedXYZStream ( ) const
inline

Definition at line 96 of file Position.h.

◆ PositionXYStream() [1/2]

Streamer< XY > Position::PositionXYStream ( )
inline

Definition at line 89 of file Position.h.

◆ PositionXYStream() [2/2]

ConstStreamer< XY > Position::PositionXYStream ( ) const
inline

Definition at line 90 of file Position.h.

◆ PositionXYZOStream() [1/2]

Streamer< XYZO > Position::PositionXYZOStream ( )
inline

Definition at line 93 of file Position.h.

+ Here is the caller graph for this function:

◆ PositionXYZOStream() [2/2]

ConstStreamer< XYZO > Position::PositionXYZOStream ( ) const
inline

Definition at line 94 of file Position.h.

◆ PositionXYZStream() [1/2]

Streamer< XYZ > Position::PositionXYZStream ( )
inline

Definition at line 91 of file Position.h.

+ Here is the caller graph for this function:

◆ PositionXYZStream() [2/2]

ConstStreamer< XYZ > Position::PositionXYZStream ( ) const
inline

Definition at line 92 of file Position.h.

◆ Relocate() [1/5]

void Position::Relocate ( float  x,
float  y 
)
inline

Definition at line 66 of file Position.h.

+ Here is the caller graph for this function:

◆ Relocate() [2/5]

void Position::Relocate ( float  x,
float  y,
float  z 
)
inline

Definition at line 67 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Relocate() [3/5]

void Position::Relocate ( float  x,
float  y,
float  z,
float  o 
)
inline

Definition at line 68 of file Position.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Relocate() [4/5]

void Position::Relocate ( Position const &  pos)
inline

Definition at line 69 of file Position.h.

◆ Relocate() [5/5]

void Position::Relocate ( Position const *  pos)
inline

Definition at line 70 of file Position.h.

◆ RelocateOffset()

void Position::RelocateOffset ( Position const &  offset)

Definition at line 36 of file Position.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetOrientation()

void Position::SetOrientation ( float  orientation)
inline

Definition at line 74 of file Position.h.

+ Here is the caller graph for this function:

◆ ToAbsoluteAngle()

float Position::ToAbsoluteAngle ( float  relAngle) const
inline

Definition at line 136 of file Position.h.

+ Here is the caller graph for this function:

◆ ToRelativeAngle()

float Position::ToRelativeAngle ( float  absAngle) const
inline

Definition at line 138 of file Position.h.

◆ ToString()

std::string Position::ToString ( ) const

Definition at line 149 of file Position.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_orientation

float Position::m_orientation
private

Definition at line 61 of file Position.h.

◆ m_positionX

float Position::m_positionX

Definition at line 56 of file Position.h.

◆ m_positionY

float Position::m_positionY

Definition at line 57 of file Position.h.

◆ m_positionZ

float Position::m_positionZ

Definition at line 58 of file Position.h.


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