TrinityCore
WorldLocation Class Reference

#include <Position.h>

Public Member Functions

 WorldLocation (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
 WorldLocation (uint32 mapId, Position const &position)
 
void WorldRelocate (WorldLocation const &loc)
 
void WorldRelocate (WorldLocation const *loc)
 
void WorldRelocate (uint32 mapId, Position const &pos)
 
void WorldRelocate (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
WorldLocation GetWorldLocation () const
 
uint32 GetMapId () const
 
std::string GetDebugInfo () const
 
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
 
bool operator== (Position const &a) const
 
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
 
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
 

Public Attributes

uint32 m_mapId
 
- Public Attributes inherited from Position
float m_positionX
 
float m_positionY
 
float m_positionZ
 

Additional Inherited Members

- Static Public Member Functions inherited from Position
static float NormalizeOrientation (float o)
 

Constructor & Destructor Documentation

◆ WorldLocation() [1/2]

WorldLocation::WorldLocation ( uint32  mapId = MAPID_INVALID,
float  x = 0.f,
float  y = 0.f,
float  z = 0.f,
float  o = 0.f 
)
inlineexplicit
167  : Position(x, y, z, o), m_mapId(mapId) { }
uint32 m_mapId
Definition: Position.h:188
Position(float x=0, float y=0, float z=0, float o=0)
Definition: Position.h:29
+ Here is the caller graph for this function:

◆ WorldLocation() [2/2]

WorldLocation::WorldLocation ( uint32  mapId,
Position const &  position 
)
inline
170  : Position(position), m_mapId(mapId) { }
uint32 m_mapId
Definition: Position.h:188
Position(float x=0, float y=0, float z=0, float o=0)
Definition: Position.h:29

Member Function Documentation

◆ GetDebugInfo()

std::string WorldLocation::GetDebugInfo ( ) const
204 {
205  std::stringstream sstr;
206  MapEntry const* mapEntry = sMapStore.LookupEntry(m_mapId);
207  sstr << "MapID: " << m_mapId << " Map name: '" << (mapEntry ? mapEntry->MapName[sWorld->GetDefaultDbcLocale()] : "<not found>") <<"' " << Position::ToString();
208  return sstr.str();
209 }
Definition: DB2Structure.h:2488
#define sWorld
Definition: World.h:946
uint32 m_mapId
Definition: Position.h:188
LocalizedString MapName
Definition: DB2Structure.h:2492
std::string ToString() const
Definition: Position.cpp:128
DB2Storage< MapEntry > sMapStore("Map.db2", MapLoadInfo::Instance())
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMapId()

uint32 WorldLocation::GetMapId ( ) const
inline
186 { return m_mapId; }
uint32 m_mapId
Definition: Position.h:188

◆ GetWorldLocation()

WorldLocation WorldLocation::GetWorldLocation ( ) const
inline
182  {
183  return *this;
184  }
+ Here is the caller graph for this function:

◆ WorldRelocate() [1/4]

void WorldLocation::WorldRelocate ( WorldLocation const &  loc)
inline
172 { m_mapId = loc.GetMapId(); Relocate(loc); }
uint32 m_mapId
Definition: Position.h:188
void Relocate(float x, float y)
Definition: Position.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WorldRelocate() [2/4]

void WorldLocation::WorldRelocate ( WorldLocation const *  loc)
inline
173 { m_mapId = loc->GetMapId(); Relocate(loc); }
uint32 m_mapId
Definition: Position.h:188
void Relocate(float x, float y)
Definition: Position.h:64
+ Here is the call graph for this function:

◆ WorldRelocate() [3/4]

void WorldLocation::WorldRelocate ( uint32  mapId,
Position const &  pos 
)
inline
174 { m_mapId = mapId; Relocate(pos); }
uint32 m_mapId
Definition: Position.h:188
void Relocate(float x, float y)
Definition: Position.h:64

◆ WorldRelocate() [4/4]

void WorldLocation::WorldRelocate ( uint32  mapId = MAPID_INVALID,
float  x = 0.f,
float  y = 0.f,
float  z = 0.f,
float  o = 0.f 
)
inline
176  {
177  m_mapId = mapId;
178  Relocate(x, y, z, o);
179  }
uint32 m_mapId
Definition: Position.h:188
void Relocate(float x, float y)
Definition: Position.h:64

Member Data Documentation

◆ m_mapId

uint32 WorldLocation::m_mapId

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