![]() |
TrinityCore
|
#include <MapTree.h>
Public Member Functions | |
| StaticMapTree (uint32 mapID, std::string const &basePath) | |
| ~StaticMapTree () | |
| Make sure to call unloadMap() to unregister acquired model references before destroying. | |
| bool | isInLineOfSight (G3D::Vector3 const &pos1, G3D::Vector3 const &pos2, ModelIgnoreFlags ignoreFlags) const |
| bool | getObjectHitPos (G3D::Vector3 const &pos1, G3D::Vector3 const &pos2, G3D::Vector3 &pResultHitPos, float pModifyDist) const |
| float | getHeight (G3D::Vector3 const &pPos, float maxSearchDist) const |
| bool | GetLocationInfo (G3D::Vector3 const &pos, StaticMapTreeLocationInfo &info) const |
| LoadResult | InitMap (std::string const &fname) |
| void | UnloadMap () |
| LoadResult | LoadMapTile (uint32 tileX, uint32 tileY, VMapManager *vm) |
| void | UnloadMapTile (uint32 tileX, uint32 tileY) |
| uint32 | numLoadedTiles () const |
| std::span< ModelInstance const > | getModelInstances () const |
Static Public Member Functions | |
| static uint32 | packTileID (uint32 tileX, uint32 tileY) |
| static void | unpackTileID (uint32 ID, uint32 &tileX, uint32 &tileY) |
| static LoadResult | CanLoadMap (std::string const &basePath, uint32 mapID, uint32 tileX, uint32 tileY, VMapManager *vm) |
Private Types | |
| typedef std::unordered_map< uint32, std::vector< uint32 > > | loadedTileMap |
Private Member Functions | |
| bool | getIntersectionTime (G3D::Ray const &pRay, float &pMaxDist, bool pStopAtFirstHit, ModelIgnoreFlags ignoreFlags) const |
| StaticMapTree (StaticMapTree const &right)=delete | |
| StaticMapTree & | operator= (StaticMapTree const &right)=delete |
Private Attributes | |
| uint32 | iMapID |
| BIH | iTree |
| std::vector< ModelInstance > | iTreeValues |
| loadedTileMap | iLoadedTiles |
| std::string | iBasePath |
|
private |
| VMAP::StaticMapTree::StaticMapTree | ( | uint32 | mapID, |
| std::string const & | basePath | ||
| ) |
Definition at line 78 of file MapTree.cpp.
References iBasePath.
|
default |
Make sure to call unloadMap() to unregister acquired model references before destroying.
|
privatedelete |
|
static |
Definition at line 227 of file MapTree.cpp.
References VMAP::FileNotFound, VMAP::VMapManager::getMapFileName(), VMAP::OpenMapTileFile(), VMAP::readChunk(), VMAP::Success, VMAP::TileFileOpenResult::TileFile, VMAP::VersionMismatch, and VMAP::VMAP_MAGIC.
Referenced by VMAP::VMapManager::existsMap().
| float VMAP::StaticMapTree::getHeight | ( | G3D::Vector3 const & | pPos, |
| float | maxSearchDist | ||
| ) | const |
Definition at line 176 of file MapTree.cpp.
References getIntersectionTime(), and VMAP::Nothing.
|
private |
If intersection is found within pMaxDist, sets pMaxDist to intersection distance and returns true. Else, pMaxDist is not modified and returns false;
Definition at line 95 of file MapTree.cpp.
References VMAP::MapRayCallback::didHit(), BIH::intersectRay(), iTree, and iTreeValues.
Referenced by getHeight(), getObjectHitPos(), and isInLineOfSight().
| bool VMAP::StaticMapTree::GetLocationInfo | ( | G3D::Vector3 const & | pos, |
| StaticMapTreeLocationInfo & | info | ||
| ) | const |
Definition at line 71 of file MapTree.cpp.
References VMAP::StaticMapTreeLocationInfo::hitInstance, BIH::intersectPoint(), iTree, iTreeValues, and VMAP::LocationInfoCallback::locInfo.
| std::span< ModelInstance const > VMAP::StaticMapTree::getModelInstances | ( | ) | const |
Definition at line 403 of file MapTree.cpp.
References iTreeValues.
| bool VMAP::StaticMapTree::getObjectHitPos | ( | G3D::Vector3 const & | pos1, |
| G3D::Vector3 const & | pos2, | ||
| G3D::Vector3 & | pResultHitPos, | ||
| float | pModifyDist | ||
| ) | const |
When moving from pos1 to pos2 check if we hit an object. Return true and the position if we hit one Return the hit pos or the original dest pos
Definition at line 131 of file MapTree.cpp.
References ASSERT, getIntersectionTime(), and VMAP::Nothing.
| LoadResult VMAP::StaticMapTree::InitMap | ( | std::string const & | fname | ) |
Definition at line 255 of file MapTree.cpp.
References VMAP::FileNotFound, iBasePath, iTree, iTreeValues, BIH::primCount(), VMAP::readChunk(), BIH::readFromFile(), VMAP::ReadFromFileFailed, VMAP::Success, TC_LOG_DEBUG, VMAP::VersionMismatch, and VMAP::VMAP_MAGIC.
| bool VMAP::StaticMapTree::isInLineOfSight | ( | G3D::Vector3 const & | pos1, |
| G3D::Vector3 const & | pos2, | ||
| ModelIgnoreFlags | ignoreFlags | ||
| ) | const |
Definition at line 106 of file MapTree.cpp.
References ASSERT, and getIntersectionTime().
| LoadResult VMAP::StaticMapTree::LoadMapTile | ( | uint32 | tileX, |
| uint32 | tileY, | ||
| VMapManager * | vm | ||
| ) |
Definition at line 287 of file MapTree.cpp.
References VMAP::VMapManager::acquireModelInstance(), VMAP::FileNotFound, VMAP::ModelMinimalData::flags, iBasePath, VMAP::ModelMinimalData::ID, iLoadedTiles, iMapID, iTreeValues, VMAP::VMapManager::LoadPathOnlyModels, VMAP::MOD_PATH_ONLY, VMAP::TileFileOpenResult::Name, VMAP::ModelSpawn::name, VMAP::OpenMapTileFile(), packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), VMAP::ReadFromFileFailed, VMAP::TileFileOpenResult::SpawnIndicesFile, Trinity::StringFormat(), VMAP::Success, TC_LOG_DEBUG, TC_LOG_ERROR, TC_METRIC_EVENT, VMAP::TileFileOpenResult::TileFile, VMAP::VersionMismatch, and VMAP::VMAP_MAGIC.
|
inline |
|
privatedelete |
Definition at line 64 of file MapTree.h.
Referenced by VMAP::TileAssembler::convertMap(), MMAP::MapBuilder::discoverTiles(), LoadMapTile(), and UnloadMapTile().
| void VMAP::StaticMapTree::UnloadMap | ( | ) |
Definition at line 279 of file MapTree.cpp.
References iLoadedTiles, and iTreeValues.
Definition at line 377 of file MapTree.cpp.
References iLoadedTiles, iMapID, iTreeValues, packTileID(), Trinity::StringFormat(), TC_LOG_ERROR, and TC_METRIC_EVENT.
|
inlinestatic |
Definition at line 65 of file MapTree.h.
Referenced by MMAP::MapBuilder::buildMap(), MMAP::MapBuilder::buildNavMesh(), and VMAP::TileAssembler::convertMap().
|
private |
Definition at line 58 of file MapTree.h.
Referenced by InitMap(), LoadMapTile(), and StaticMapTree().
|
private |
Definition at line 57 of file MapTree.h.
Referenced by LoadMapTile(), UnloadMap(), and UnloadMapTile().
|
private |
Definition at line 50 of file MapTree.h.
Referenced by LoadMapTile(), and UnloadMapTile().
|
private |
Definition at line 51 of file MapTree.h.
Referenced by getIntersectionTime(), GetLocationInfo(), and InitMap().
|
private |
Definition at line 52 of file MapTree.h.
Referenced by getIntersectionTime(), GetLocationInfo(), getModelInstances(), InitMap(), LoadMapTile(), UnloadMap(), and UnloadMapTile().