AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
WorldLocation Class Reference

#include "Position.h"

Inheritance diagram for WorldLocation:
Position WorldObject Corpse DynamicObject GameObject Unit Transport Creature Player MotionTransport StaticTransport TempSummon Minion Guardian Puppet Totem Pet

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 (const WorldLocation &loc)
 
void WorldRelocate (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
void SetMapId (uint32 mapId)
 
uint32 GetMapId () const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y) const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y, float &z) const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y, float &z, float &o) const
 
void GetWorldLocation (WorldLocation *location) const
 
WorldLocation GetWorldLocation () const
 
std::string GetDebugInfo () const
 
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
 
 Position (Position const &loc)
 
 Position (Position &&)=default
 
Positionoperator= (const Position &)=default
 
Positionoperator= (Position &&)=default
 
bool operator== (Position const &a) const
 
bool operator!= (Position const &a)
 
 operator G3D::Vector3 () const
 
void Relocate (float x, float y)
 
void Relocate (float x, float y, float z)
 
void Relocate (float x, float y, float z, float orientation)
 
void Relocate (const Position &pos)
 
void Relocate (const Position *pos)
 
void RelocatePolarOffset (float angle, float dist, float z=0.0f)
 
void RelocateOffset (const Position &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
 
Position::PositionXYZStreamer PositionXYZStream ()
 
Position::PositionXYZOStreamer PositionXYZOStream ()
 
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 (const Position &endPos, Position &retOffset) const
 
Position GetPositionWithOffset (Position const &offset) const
 
float GetAngle (const Position *pos) const
 
float GetAngle (float x, float y) const
 
float GetAbsoluteAngle (float x, float y) const
 
float GetAbsoluteAngle (Position const &pos) const
 
float GetAbsoluteAngle (Position const *pos) const
 
float GetRelativeAngle (const Position *pos) const
 
float GetRelativeAngle (float x, float y) const
 
float ToAbsoluteAngle (float relAngle) const
 
void GetSinCos (float x, float y, float &vsin, float &vcos) const
 
bool IsInDist2d (float x, float y, float dist) const
 
bool IsInDist2d (const Position *pos, float dist) const
 
bool IsInDist (float x, float y, float z, float dist) const
 
bool IsInDist (const Position *pos, float dist) const
 
bool IsWithinBox (const Position &center, float xradius, float yradius, float zradius) const
 
bool HasInArc (float arcangle, const Position *pos, float targetRadius=0.0f) const
 
bool HasInLine (Position const *pos, float width) const
 
std::string ToString () const
 

Public Attributes

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

Additional Inherited Members

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

Detailed Description

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
254 : Position(x, y, z, o), m_mapId(_mapId) { }
Definition: Position.h:28
uint32 m_mapId
Definition: Position.h:319

◆ WorldLocation() [2/2]

WorldLocation::WorldLocation ( uint32  mapId,
Position const &  position 
)
inline
257 : Position(position), m_mapId(mapId) { }

Member Function Documentation

◆ GetDebugInfo()

std::string WorldLocation::GetDebugInfo ( ) const
213{
214 std::stringstream sstr;
215 sstr << "MapID: " << m_mapId << " " << Position::ToString();
216 return sstr.str();
217}
std::string ToString() const
Definition: Position.cpp:51

References m_mapId, and Position::ToString().

Referenced by WorldObject::GetDebugInfo().

◆ GetMapId()

uint32 WorldLocation::GetMapId ( ) const
inline
277 {
278 return m_mapId;
279 }

References m_mapId.

Referenced by Group::_homebindIfInstance(), Player::_LoadItem(), KillRewarder::_RewardGroup(), Player::_SaveCharacter(), Player::_SaveEntryPoint(), WorldObject::AddObjectToRemoveList(), Map::AddObjectToRemoveList(), Map::AddObjectToSwitchList(), Pet::AddToWorld(), Player::BuildPlayerRepop(), Player::CalculateTalentsPoints(), Group::CanJoinBattlegroundQueue(), Player::CheckAreaExploreAndOutdoor(), Spell::CheckCast(), Map::CheckCollisionAndGetValidCoords(), Player::ContinueTaxiFlight(), BattlegroundSA::DefendersPortalTeleport(), Player::DestroyZoneLimitedItem(), go_commandscript::DoTeleport(), ScriptedAI::DoTeleportAll(), ScriptedAI::DoTeleportPlayer(), Spell::EffectBind(), Spell::EffectResurrect(), Spell::EffectResurrectNew(), Spell::EffectSummonPlayer(), Spell::EffectSummonRaFFriend(), Spell::EffectTeleportUnits(), SendEncounterUnit::Execute(), Unit::ExecuteDelayedUnitRelocationEvent(), npc_dark_iron_guzzler::FindNextKeg(), npc_dark_iron_attack_generator::FinishAttackDueToWin(), lfg::LFGMgr::FinishDungeon(), Acore::XP::Gain(), MapMgr::GetAreaId(), Graveyard::GetClosestGraveyard(), Player::GetNextQuest(), npc_dark_iron_attack_generator::GetRandomBartender(), MapMgr::GetZoneId(), Group::GroupLoot(), WorldSession::HandleAreaTriggerOpcode(), WorldSession::HandleBattlemasterJoinOpcode(), WorldSession::HandleCharFactionOrRaceChangeCallback(), WorldSession::HandleCorpseQueryOpcode(), gobject_commandscript::HandleGameObjectMoveCommand(), gobject_commandscript::HandleGameObjectNearCommand(), gobject_commandscript::HandleGameObjectTargetCommand(), go_commandscript::HandleGoGridCommand(), go_commandscript::HandleGoXYZCommand(), misc_commandscript::HandleGPSCommand(), WorldSession::HandleGroupInviteOpcode(), misc_commandscript::HandleGroupSummonCommand(), instance_commandscript::HandleInstanceUnbindCommand(), mmaps_commandscript::HandleMmapLoadedTilesCommand(), mmaps_commandscript::HandleMmapLocCommand(), mmaps_commandscript::HandleMmapPathCommand(), mmaps_commandscript::HandleMmapStatsCommand(), WorldSession::HandleMoveWorldportAck(), npc_commandscript::HandleNpcMoveCommand(), npc_commandscript::HandleNpcNearCommand(), misc_commandscript::HandlePInfoCommand(), WorldSession::HandlePlayerLoginFromDB(), WorldSession::HandlePlayerLoginToCharInWorld(), spell_brewfest_toss_mug::HandleScriptEffect(), ArenaSpectator::HandleSpectatorSpectateCommand(), misc_commandscript::HandleSummonCommand(), tele_commandscript::HandleTeleAddCommand(), tele_commandscript::HandleTeleCommand(), Player::HasCorpse(), Player::IsAtRecruitAFriendDistance(), DisableMgr::IsDisabledFor(), Unit::isInAccessiblePlaceFor(), Player::IsInAreaTriggerRadius(), WorldObject::IsInWintergrasp(), MapMgr::IsValidMapCoord(), Player::KillPlayer(), spell_uldaman_stoned::spell_uldaman_stoned_AuraScript::Load(), Player::LoadCorpse(), Player::LoadFromDB(), LogCommandUsage(), AchievementCriteriaData::Meets(), npc_brewfest_bark_trigger::MoveInLineOfSight(), Unit::NearTeleportTo(), Group::NeedBeforeGreed(), Unit::OutDebugInfo(), PathGenerator::PathGenerator(), MapMgr::PlayerCannotEnter(), npc_dark_iron_attack_generator::PrepareEvent(), Player::PrepareQuestMenu(), BfGraveyard::RelocateDeadPlayers(), spell_quest_dragonmaw_race_generic::RelocateDest(), Group::RemoveMember(), boss_victor_nefarius::boss_victor_nefariusAI::Reset(), Player::SavePositionInDB(), Player::SaveRecallPosition(), Corpse::SaveToDB(), Creature::SaveToDB(), GameObject::SaveToDB(), Spell::SelectImplicitCasterDestTargets(), Player::SendInitWorldStates(), WorldSession::SendLearnNewTaxiNode(), WorldSession::SendTaxiMenu(), Player::SendTaxiNodeStatusMultiple(), WorldSession::SendTaxiStatus(), Pet::setDeathState(), Player::SetEntryPoint(), Player::SetHomebind(), Player::SetMover(), lfg::LFGMgr::TeleportPlayer(), Player::TeleportTo(), Player::Update(), npc_dark_iron_attack_generator::UpdateAI(), boss_grandmaster_vorpil::boss_grandmaster_vorpilAI::UpdateAI(), Player::UpdateAreaDependentAuras(), GameObject::Use(), and WorldRelocate().

◆ GetWorldLocation() [1/5]

WorldLocation WorldLocation::GetWorldLocation ( ) const
inline
315 {
316 return *this;
317 }

◆ GetWorldLocation() [2/5]

void WorldLocation::GetWorldLocation ( uint32 mapId,
float &  x,
float &  y 
) const
inline
282 {
283 mapId = m_mapId;
284 x = m_positionX;
285 y = m_positionY;
286 }
float m_positionX
Definition: Position.h:56
float m_positionY
Definition: Position.h:57

References m_mapId, Position::m_positionX, and Position::m_positionY.

Referenced by Spell::EffectBind(), Graveyard::GetClosestGraveyard(), and lfg::LFGMgr::TeleportPlayer().

◆ GetWorldLocation() [3/5]

void WorldLocation::GetWorldLocation ( uint32 mapId,
float &  x,
float &  y,
float &  z 
) const
inline
289 {
290 mapId = m_mapId;
291 x = m_positionX;
292 y = m_positionY;
293 z = m_positionZ;
294 }
float m_positionZ
Definition: Position.h:58

References m_mapId, Position::m_positionX, Position::m_positionY, and Position::m_positionZ.

◆ GetWorldLocation() [4/5]

void WorldLocation::GetWorldLocation ( uint32 mapId,
float &  x,
float &  y,
float &  z,
float &  o 
) const
inline
297 {
298 mapId = m_mapId;
299 x = m_positionX;
300 y = m_positionY;
301 z = m_positionZ;
302 o = GetOrientation();
303 }
float GetOrientation() const
Definition: Position.h:120

References Position::GetOrientation(), m_mapId, Position::m_positionX, Position::m_positionY, and Position::m_positionZ.

◆ GetWorldLocation() [5/5]

void WorldLocation::GetWorldLocation ( WorldLocation location) const
inline
306 {
307 if (location)
308 {
310 location->SetMapId(m_mapId);
311 }
312 }
void Relocate(float x, float y)
Definition: Position.h:73
void SetMapId(uint32 mapId)
Definition: Position.h:271

References Position::GetOrientation(), m_mapId, Position::m_positionX, Position::m_positionY, Position::m_positionZ, Position::Relocate(), and SetMapId().

◆ SetMapId()

void WorldLocation::SetMapId ( uint32  mapId)
inline
272 {
273 m_mapId = mapId;
274 }

References m_mapId.

Referenced by GetWorldLocation().

◆ WorldRelocate() [1/2]

void WorldLocation::WorldRelocate ( const WorldLocation loc)
inline

◆ WorldRelocate() [2/2]

void WorldLocation::WorldRelocate ( uint32  mapId = MAPID_INVALID,
float  x = 0.f,
float  y = 0.f,
float  z = 0.f,
float  o = 0.f 
)
inline
266 {
267 m_mapId = mapId;
268 Relocate(x, y, z, o);
269 }

References m_mapId, and Position::Relocate().

Member Data Documentation

◆ m_mapId