TrinityCore
|
#include <TerrainMgr.h>
Public Member Functions | |
TerrainInfo (uint32 mapId) | |
TerrainInfo (TerrainInfo const &)=delete | |
TerrainInfo (TerrainInfo &&)=delete | |
TerrainInfo & | operator= (TerrainInfo const &)=delete |
TerrainInfo & | operator= (TerrainInfo &&)=delete |
~TerrainInfo () | |
uint32 | GetId () const |
char const * | GetMapName () const |
void | DiscoverGridMapFiles () |
bool | HasChildTerrainGridFile (uint32 mapId, int32 gx, int32 gy) const |
void | AddChildTerrain (std::shared_ptr< TerrainInfo > childTerrain) |
void | LoadMapAndVMap (int32 gx, int32 gy) |
void | LoadMMapInstance (uint32 mapId, uint32 instanceId) |
void | UnloadMap (int32 gx, int32 gy) |
void | UnloadMMapInstance (uint32 mapId, uint32 instanceId) |
void | CleanUpGrids (uint32 diff) |
void | GetFullTerrainStatusForPosition (PhaseShift const &phaseShift, uint32 mapId, float x, float y, float z, PositionFullTerrainStatus &data, Optional< map_liquidHeaderTypeFlags > reqLiquidType={}, float collisionHeight=2.03128f, DynamicMapTree const *dynamicMapTree=nullptr) |
ZLiquidStatus | GetLiquidStatus (PhaseShift const &phaseShift, uint32 mapId, float x, float y, float z, Optional< map_liquidHeaderTypeFlags > ReqLiquidType={}, LiquidData *data=nullptr, float collisionHeight=2.03128f) |
bool | GetAreaInfo (PhaseShift const &phaseShift, uint32 mapId, float x, float y, float z, uint32 &mogpflags, int32 &adtId, int32 &rootId, int32 &groupId, DynamicMapTree const *dynamicMapTree=nullptr) |
uint32 | GetAreaId (PhaseShift const &phaseShift, uint32 mapId, float x, float y, float z, DynamicMapTree const *dynamicMapTree=nullptr) |
uint32 | GetAreaId (PhaseShift const &phaseShift, uint32 mapId, Position const &pos, DynamicMapTree const *dynamicMapTree=nullptr) |
uint32 | GetZoneId (PhaseShift const &phaseShift, uint32 mapId, float x, float y, float z, DynamicMapTree const *dynamicMapTree=nullptr) |
uint32 | GetZoneId (PhaseShift const &phaseShift, uint32 mapId, Position const &pos, DynamicMapTree const *dynamicMapTree=nullptr) |
void | GetZoneAndAreaId (PhaseShift const &phaseShift, uint32 mapId, uint32 &zoneid, uint32 &areaid, float x, float y, float z, DynamicMapTree const *dynamicMapTree=nullptr) |
void | GetZoneAndAreaId (PhaseShift const &phaseShift, uint32 mapId, uint32 &zoneid, uint32 &areaid, Position const &pos, DynamicMapTree const *dynamicMapTree=nullptr) |
float | GetMinHeight (PhaseShift const &phaseShift, uint32 mapId, float x, float y) |
float | GetGridHeight (PhaseShift const &phaseShift, uint32 mapId, float x, float y) |
float | GetStaticHeight (PhaseShift const &phaseShift, uint32 mapId, float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) |
float | GetStaticHeight (PhaseShift const &phaseShift, uint32 mapId, Position const &pos, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) |
float | GetWaterLevel (PhaseShift const &phaseShift, uint32 mapId, float x, float y) |
bool | IsInWater (PhaseShift const &phaseShift, uint32 mapId, float x, float y, float z, LiquidData *data=nullptr) |
bool | IsUnderWater (PhaseShift const &phaseShift, uint32 mapId, float x, float y, float z) |
float | GetWaterOrGroundLevel (PhaseShift const &phaseShift, uint32 mapId, float x, float y, float z, float *ground=nullptr, bool swim=false, float collisionHeight=2.03128f, DynamicMapTree const *dynamicMapTree=nullptr) |
Static Public Member Functions | |
static bool | ExistMap (uint32 mapid, int32 gx, int32 gy, bool log=true) |
static bool | ExistVMap (uint32 mapid, int32 gx, int32 gy) |
Private Member Functions | |
void | LoadMapAndVMapImpl (int32 gx, int32 gy) |
void | LoadMMapInstanceImpl (uint32 mapId, uint32 instanceId) |
void | LoadMap (int32 gx, int32 gy) |
void | LoadVMap (int32 gx, int32 gy) |
void | LoadMMap (int32 gx, int32 gy) |
void | UnloadMapImpl (int32 gx, int32 gy) |
void | UnloadMMapInstanceImpl (uint32 mapId, uint32 instanceId) |
GridMap * | GetGrid (uint32 mapId, float x, float y, bool loadIfMissing=true) |
Static Private Member Functions | |
static constexpr int32 | GetBitsetIndex (int32 gx, int32 gy) |
Private Attributes | |
uint32 | _mapId |
TerrainInfo * | _parentTerrain |
std::vector< std::shared_ptr< TerrainInfo > > | _childTerrain |
std::mutex | _loadMutex |
std::unique_ptr< GridMap > | _gridMap [MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS] |
std::atomic< uint16 > | _referenceCountFromMap [MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS] |
std::bitset< MAX_NUMBER_OF_GRIDS *MAX_NUMBER_OF_GRIDS > | _loadedGrids |
std::bitset< MAX_NUMBER_OF_GRIDS *MAX_NUMBER_OF_GRIDS > | _gridFileExists |
TimeTracker | _cleanupTimer |
Static Private Attributes | |
static constexpr Milliseconds | CleanupInterval = 1min |
Definition at line 37 of file TerrainMgr.h.
|
explicit |
Definition at line 35 of file TerrainMgr.cpp.
|
delete |
|
delete |
TerrainInfo::~TerrainInfo | ( | ) |
void TerrainInfo::AddChildTerrain | ( | std::shared_ptr< TerrainInfo > | childTerrain | ) |
Definition at line 151 of file TerrainMgr.cpp.
void TerrainInfo::CleanUpGrids | ( | uint32 | diff | ) |
void TerrainInfo::DiscoverGridMapFiles | ( | ) |
Definition at line 77 of file TerrainMgr.cpp.
Definition at line 110 of file TerrainMgr.cpp.
uint32 TerrainInfo::GetAreaId | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y, | ||
float | z, | ||
DynamicMapTree const * | dynamicMapTree = nullptr |
||
) |
Definition at line 615 of file TerrainMgr.cpp.
|
inline |
Definition at line 86 of file TerrainMgr.h.
bool TerrainInfo::GetAreaInfo | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y, | ||
float | z, | ||
uint32 & | mogpflags, | ||
int32 & | adtId, | ||
int32 & | rootId, | ||
int32 & | groupId, | ||
DynamicMapTree const * | dynamicMapTree = nullptr |
||
) |
Definition at line 575 of file TerrainMgr.cpp.
void TerrainInfo::GetFullTerrainStatusForPosition | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y, | ||
float | z, | ||
PositionFullTerrainStatus & | data, | ||
Optional< map_liquidHeaderTypeFlags > | reqLiquidType = {} , |
||
float | collisionHeight = 2.03128f , |
||
DynamicMapTree const * | dynamicMapTree = nullptr |
||
) |
|
private |
Definition at line 281 of file TerrainMgr.cpp.
float TerrainInfo::GetGridHeight | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y | ||
) |
Definition at line 677 of file TerrainMgr.cpp.
|
inline |
ZLiquidStatus TerrainInfo::GetLiquidStatus | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y, | ||
float | z, | ||
Optional< map_liquidHeaderTypeFlags > | ReqLiquidType = {} , |
||
LiquidData * | data = nullptr , |
||
float | collisionHeight = 2.03128f |
||
) |
Definition at line 475 of file TerrainMgr.cpp.
char const * TerrainInfo::GetMapName | ( | ) | const |
Definition at line 45 of file TerrainMgr.cpp.
float TerrainInfo::GetMinHeight | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y | ||
) |
float TerrainInfo::GetStaticHeight | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y, | ||
float | z, | ||
bool | checkVMap = true , |
||
float | maxSearchDist = DEFAULT_HEIGHT_SEARCH |
||
) |
Definition at line 685 of file TerrainMgr.cpp.
|
inline |
Definition at line 95 of file TerrainMgr.h.
float TerrainInfo::GetWaterLevel | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y | ||
) |
float TerrainInfo::GetWaterOrGroundLevel | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y, | ||
float | z, | ||
float * | ground = nullptr , |
||
bool | swim = false , |
||
float | collisionHeight = 2.03128f , |
||
DynamicMapTree const * | dynamicMapTree = nullptr |
||
) |
void TerrainInfo::GetZoneAndAreaId | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
uint32 & | zoneid, | ||
uint32 & | areaid, | ||
float | x, | ||
float | y, | ||
float | z, | ||
DynamicMapTree const * | dynamicMapTree = nullptr |
||
) |
|
inline |
Definition at line 90 of file TerrainMgr.h.
uint32 TerrainInfo::GetZoneId | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y, | ||
float | z, | ||
DynamicMapTree const * | dynamicMapTree = nullptr |
||
) |
|
inline |
Definition at line 88 of file TerrainMgr.h.
Definition at line 145 of file TerrainMgr.cpp.
bool TerrainInfo::IsInWater | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y, | ||
float | z, | ||
LiquidData * | data = nullptr |
||
) |
bool TerrainInfo::IsUnderWater | ( | PhaseShift const & | phaseShift, |
uint32 | mapId, | ||
float | x, | ||
float | y, | ||
float | z | ||
) |
Definition at line 191 of file TerrainMgr.cpp.
Definition at line 174 of file TerrainMgr.cpp.
Definition at line 237 of file TerrainMgr.cpp.
Definition at line 186 of file TerrainMgr.cpp.
Definition at line 214 of file TerrainMgr.cpp.
|
delete |
|
delete |
Definition at line 250 of file TerrainMgr.cpp.
Definition at line 264 of file TerrainMgr.cpp.
Definition at line 276 of file TerrainMgr.cpp.
|
private |
Definition at line 109 of file TerrainMgr.h.
|
private |
Definition at line 120 of file TerrainMgr.h.
|
private |
Definition at line 115 of file TerrainMgr.h.
|
private |
Definition at line 112 of file TerrainMgr.h.
|
private |
Definition at line 114 of file TerrainMgr.h.
|
private |
Definition at line 111 of file TerrainMgr.h.
|
private |
Definition at line 106 of file TerrainMgr.h.
|
private |
Definition at line 108 of file TerrainMgr.h.
|
private |
Definition at line 113 of file TerrainMgr.h.
|
staticconstexprprivate |
Definition at line 117 of file TerrainMgr.h.