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

#include <Position.h>

+ Inheritance diagram for Position:

Classes

struct  ConstStreamer
 
struct  Streamer
 

Public Member Functions

constexpr Position ()
 
constexpr Position (float x, float y)
 
constexpr Position (float x, float y, float z)
 
constexpr Position (float x, float y, float z, float o)
 
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
 
Position GetPositionOffsetTo (Position const &endPos) 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 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 &boxOrigin, float length, float width, float height) const
 
bool IsWithinVerticalCylinder (Position const &cylinderOrigin, float radius, float height, bool isDoubleVertical=false) const
 
bool IsInPolygon2D (Position const &polygonOrigin, std::span< Position const > vertices) 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 29 of file Position.h.

Constructor & Destructor Documentation

◆ Position() [1/4]

constexpr Position::Position ( )
inlineconstexpr

Definition at line 31 of file Position.h.

+ Here is the caller graph for this function:

◆ Position() [2/4]

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

Definition at line 34 of file Position.h.

◆ Position() [3/4]

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

Definition at line 37 of file Position.h.

◆ Position() [4/4]

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

Definition at line 40 of file Position.h.

Member Function Documentation

◆ GetAbsoluteAngle() [1/3]

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

Definition at line 136 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 142 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 143 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 129 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 130 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 131 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 117 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 118 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 119 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 108 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 114 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 115 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 121 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 126 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 127 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 90 of file Position.h.

◆ GetPosition() [1/4]

constexpr Position Position::GetPosition ( ) const
inlineconstexpr

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

◆ GetPosition() [3/4]

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

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

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

◆ GetPositionOffsetTo()

Position Position::GetPositionOffsetTo ( Position const &  endPos) 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 61 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 87 of file Position.h.

◆ GetPositionY()

constexpr float Position::GetPositionY ( ) const
inlineconstexpr

Definition at line 88 of file Position.h.

◆ GetPositionZ()

constexpr float Position::GetPositionZ ( ) const
inlineconstexpr

Definition at line 89 of file Position.h.

◆ GetRelativeAngle() [1/3]

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

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

◆ GetRelativeAngle() [3/3]

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

Definition at line 149 of file Position.h.

◆ HasInArc()

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

Definition at line 173 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 192 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 155 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 156 of file Position.h.

◆ IsInDist() [3/3]

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

Definition at line 157 of file Position.h.

◆ IsInDist2d() [1/3]

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

Definition at line 151 of file Position.h.

+ Here is the caller graph for this function:

◆ IsInDist2d() [2/3]

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

Definition at line 152 of file Position.h.

◆ IsInDist2d() [3/3]

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

Definition at line 153 of file Position.h.

◆ IsInPolygon2D()

bool Position::IsInPolygon2D ( Position const &  polygonOrigin,
std::span< Position const >  vertices 
) const

Definition at line 104 of file Position.cpp.

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

◆ 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 &  boxOrigin,
float  length,
float  width,
float  height 
) const

Definition at line 68 of file Position.cpp.

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

◆ IsWithinVerticalCylinder()

bool Position::IsWithinVerticalCylinder ( Position const &  cylinderOrigin,
float  radius,
float  height,
bool  isDoubleVertical = false 
) const

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

+ Here is the caller graph for this function:

◆ NormalizeOrientationConstexprWrapper()

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

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

◆ PositionPackedXYZStream() [2/2]

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

Definition at line 104 of file Position.h.

◆ PositionXYStream() [1/2]

Streamer< XY > Position::PositionXYStream ( )
inline

Definition at line 97 of file Position.h.

◆ PositionXYStream() [2/2]

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

Definition at line 98 of file Position.h.

◆ PositionXYZOStream() [1/2]

Streamer< XYZO > Position::PositionXYZOStream ( )
inline

Definition at line 101 of file Position.h.

+ Here is the caller graph for this function:

◆ PositionXYZOStream() [2/2]

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

Definition at line 102 of file Position.h.

◆ PositionXYZStream() [1/2]

Streamer< XYZ > Position::PositionXYZStream ( )
inline

Definition at line 99 of file Position.h.

◆ PositionXYZStream() [2/2]

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

Definition at line 100 of file Position.h.

◆ Relocate() [1/5]

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

Definition at line 74 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 75 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 76 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 77 of file Position.h.

◆ Relocate() [5/5]

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

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

+ Here is the caller graph for this function:

◆ ToAbsoluteAngle()

float Position::ToAbsoluteAngle ( float  relAngle) const
inline

Definition at line 144 of file Position.h.

+ Here is the caller graph for this function:

◆ ToRelativeAngle()

float Position::ToRelativeAngle ( float  absAngle) const
inline

Definition at line 146 of file Position.h.

◆ ToString()

std::string Position::ToString ( ) const

Definition at line 202 of file Position.cpp.

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

Member Data Documentation

◆ m_orientation

float Position::m_orientation
private

Definition at line 69 of file Position.h.

◆ m_positionX

float Position::m_positionX

Definition at line 64 of file Position.h.

◆ m_positionY

float Position::m_positionY

Definition at line 65 of file Position.h.

◆ m_positionZ

float Position::m_positionZ

Definition at line 66 of file Position.h.


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