TrinityCore
Position Struct Reference

#include <Position.h>

+ Inheritance diagram for Position:

Classes

struct  ConstStreamer
 
struct  Streamer
 

Public Member Functions

constexpr Position (float x=0, float y=0, float z=0, float o=0)
 
bool operator== (Position const &a) const
 
constexpr void Relocate (float x, float y)
 
constexpr void Relocate (float x, float y, float z)
 
constexpr void Relocate (float x, float y, float z, float o)
 
constexpr void Relocate (Position const &pos)
 
constexpr void Relocate (Position const *pos)
 
void RelocateOffset (Position const &offset)
 
constexpr void SetOrientation (float orientation)
 
constexpr float GetPositionX () const
 
constexpr float GetPositionY () const
 
constexpr float GetPositionZ () const
 
constexpr float GetOrientation () const
 
constexpr void GetPosition (float &x, float &y) const
 
constexpr void GetPosition (float &x, float &y, float &z) const
 
constexpr void GetPosition (float &x, float &y, float &z, float &o) const
 
constexpr 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
 
constexpr float GetExactDist2dSq (const float x, const float y) const
 
constexpr float GetExactDist2dSq (Position const &pos) const
 
constexpr 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
 
constexpr float GetExactDistSq (float x, float y, float z) const
 
constexpr float GetExactDistSq (Position const &pos) const
 
constexpr 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
 
constexpr bool IsInDist2d (float x, float y, float dist) const
 
constexpr bool IsInDist2d (Position const *pos, float dist) const
 
constexpr bool IsInDist (float x, float y, float z, float dist) const
 
constexpr bool IsInDist (Position const &pos, float dist) const
 
constexpr 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
 

Static Private Member Functions

static constexpr float NormalizeOrientationConstexprWrapper (float o)
 

Private Attributes

float m_orientation
 

Detailed Description

Definition at line 27 of file Position.h.

Constructor & Destructor Documentation

◆ Position()

constexpr Position::Position ( float  x = 0,
float  y = 0,
float  z = 0,
float  o = 0 
)
inlineconstexpr

Definition at line 29 of file Position.h.

+ Here is the caller graph for this function:

Member Function Documentation

◆ GetAbsoluteAngle() [1/3]

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

Definition at line 125 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 131 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 132 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 118 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 119 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 120 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 106 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 107 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 108 of file Position.h.

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

◆ GetExactDist2dSq() [1/3]

constexpr float Position::GetExactDist2dSq ( const float  x,
const float  y 
) const
inlineconstexpr

Definition at line 97 of file Position.h.

+ Here is the caller graph for this function:

◆ GetExactDist2dSq() [2/3]

constexpr float Position::GetExactDist2dSq ( Position const &  pos) const
inlineconstexpr

Definition at line 103 of file Position.h.

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

◆ GetExactDist2dSq() [3/3]

constexpr float Position::GetExactDist2dSq ( Position const *  pos) const
inlineconstexpr

Definition at line 104 of file Position.h.

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

◆ GetExactDistSq() [1/3]

constexpr float Position::GetExactDistSq ( float  x,
float  y,
float  z 
) const
inlineconstexpr

Definition at line 110 of file Position.h.

+ Here is the caller graph for this function:

◆ GetExactDistSq() [2/3]

constexpr float Position::GetExactDistSq ( Position const &  pos) const
inlineconstexpr

Definition at line 115 of file Position.h.

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

◆ GetExactDistSq() [3/3]

constexpr float Position::GetExactDistSq ( Position const *  pos) const
inlineconstexpr

Definition at line 116 of file Position.h.

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

◆ GetOrientation()

constexpr float Position::GetOrientation ( ) const
inlineconstexpr

Definition at line 79 of file Position.h.

◆ GetPosition() [1/4]

constexpr Position Position::GetPosition ( ) const
inlineconstexpr

Definition at line 84 of file Position.h.

+ Here is the caller graph for this function:

◆ GetPosition() [2/4]

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

Definition at line 81 of file Position.h.

◆ GetPosition() [3/4]

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

Definition at line 82 of file Position.h.

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

◆ GetPosition() [4/4]

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

Definition at line 83 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 47 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 58 of file Position.cpp.

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

◆ GetPositionX()

constexpr float Position::GetPositionX ( ) const
inlineconstexpr

Definition at line 76 of file Position.h.

◆ GetPositionY()

constexpr float Position::GetPositionY ( ) const
inlineconstexpr

Definition at line 77 of file Position.h.

◆ GetPositionZ()

constexpr float Position::GetPositionZ ( ) const
inlineconstexpr

Definition at line 78 of file Position.h.

◆ GetRelativeAngle() [1/3]

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

Definition at line 136 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 137 of file Position.h.

◆ GetRelativeAngle() [3/3]

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

Definition at line 138 of file Position.h.

◆ HasInArc()

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

Definition at line 99 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 118 of file Position.cpp.

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

◆ IsInDist() [1/3]

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

Definition at line 143 of file Position.h.

+ Here is the caller graph for this function:

◆ IsInDist() [2/3]

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

Definition at line 144 of file Position.h.

◆ IsInDist() [3/3]

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

Definition at line 145 of file Position.h.

◆ IsInDist2d() [1/2]

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

Definition at line 140 of file Position.h.

+ Here is the caller graph for this function:

◆ IsInDist2d() [2/2]

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

Definition at line 141 of file Position.h.

◆ IsPositionValid()

bool Position::IsPositionValid ( ) const

Definition at line 42 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 65 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 93 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 135 of file Position.cpp.

+ Here is the caller graph for this function:

◆ NormalizeOrientationConstexprWrapper()

static constexpr float Position::NormalizeOrientationConstexprWrapper ( float  o)
inlinestaticconstexprprivate

Definition at line 160 of file Position.h.

◆ operator==()

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

Definition at line 26 of file Position.cpp.

◆ PositionPackedXYZStream() [1/2]

Streamer< PackedXYZ > Position::PositionPackedXYZStream ( )
inline

Definition at line 92 of file Position.h.

◆ PositionPackedXYZStream() [2/2]

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

Definition at line 93 of file Position.h.

◆ PositionXYStream() [1/2]

Streamer< XY > Position::PositionXYStream ( )
inline

Definition at line 86 of file Position.h.

◆ PositionXYStream() [2/2]

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

Definition at line 87 of file Position.h.

◆ PositionXYZOStream() [1/2]

Streamer< XYZO > Position::PositionXYZOStream ( )
inline

Definition at line 90 of file Position.h.

+ Here is the caller graph for this function:

◆ PositionXYZOStream() [2/2]

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

Definition at line 91 of file Position.h.

◆ PositionXYZStream() [1/2]

Streamer< XYZ > Position::PositionXYZStream ( )
inline

Definition at line 88 of file Position.h.

+ Here is the caller graph for this function:

◆ PositionXYZStream() [2/2]

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

Definition at line 89 of file Position.h.

◆ Relocate() [1/5]

constexpr void Position::Relocate ( float  x,
float  y 
)
inlineconstexpr

Definition at line 63 of file Position.h.

+ Here is the caller graph for this function:

◆ Relocate() [2/5]

constexpr void Position::Relocate ( float  x,
float  y,
float  z 
)
inlineconstexpr

Definition at line 64 of file Position.h.

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

◆ Relocate() [3/5]

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

Definition at line 65 of file Position.h.

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

◆ Relocate() [4/5]

constexpr void Position::Relocate ( Position const &  pos)
inlineconstexpr

Definition at line 66 of file Position.h.

◆ Relocate() [5/5]

constexpr void Position::Relocate ( Position const *  pos)
inlineconstexpr

Definition at line 67 of file Position.h.

◆ RelocateOffset()

void Position::RelocateOffset ( Position const &  offset)

Definition at line 34 of file Position.cpp.

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

◆ SetOrientation()

constexpr void Position::SetOrientation ( float  orientation)
inlineconstexpr

Definition at line 71 of file Position.h.

+ Here is the caller graph for this function:

◆ ToAbsoluteAngle()

float Position::ToAbsoluteAngle ( float  relAngle) const
inline

Definition at line 133 of file Position.h.

+ Here is the caller graph for this function:

◆ ToRelativeAngle()

float Position::ToRelativeAngle ( float  absAngle) const
inline

Definition at line 135 of file Position.h.

◆ ToString()

std::string Position::ToString ( ) const

Definition at line 128 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 58 of file Position.h.

◆ m_positionX

float Position::m_positionX

Definition at line 53 of file Position.h.

◆ m_positionY

float Position::m_positionY

Definition at line 54 of file Position.h.

◆ m_positionZ

float Position::m_positionZ

Definition at line 55 of file Position.h.


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