![]() |
TrinityCore
|
#include <MapTree.h>
Public Member Functions | |
| StaticMapTree (uint32 mapID, const std::string &basePath) | |
| ~StaticMapTree () | |
| Make sure to call unloadMap() to unregister acquired model references before destroying. | |
| bool | isInLineOfSight (const G3D::Vector3 &pos1, const G3D::Vector3 &pos2, ModelIgnoreFlags ignoreFlags) const |
| bool | getObjectHitPos (const G3D::Vector3 &pos1, const G3D::Vector3 &pos2, G3D::Vector3 &pResultHitPos, float pModifyDist) const |
| float | getHeight (const G3D::Vector3 &pPos, float maxSearchDist) const |
| bool | GetLocationInfo (const G3D::Vector3 &pos, LocationInfo &info) const |
| bool | InitMap (const std::string &fname, VMapManager2 *vm) |
| void | UnloadMap (VMapManager2 *vm) |
| bool | LoadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *vm) |
| void | UnloadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *vm) |
| bool | isTiled () const |
| uint32 | numLoadedTiles () const |
| void | getModelInstances (ModelInstance *&models, uint32 &count) |
Static Public Member Functions | |
| static std::string | getTileFileName (uint32 mapID, uint32 tileX, uint32 tileY) |
| static uint32 | packTileID (uint32 tileX, uint32 tileY) |
| static void | unpackTileID (uint32 ID, uint32 &tileX, uint32 &tileY) |
| static LoadResult | CanLoadMap (const std::string &basePath, uint32 mapID, uint32 tileX, uint32 tileY) |
Private Types | |
| typedef std::unordered_map< uint32, bool > | loadedTileMap |
| typedef std::unordered_map< uint32, uint32 > | loadedSpawnMap |
Private Member Functions | |
| bool | getIntersectionTime (const G3D::Ray &pRay, float &pMaxDist, bool pStopAtFirstHit, ModelIgnoreFlags ignoreFlags) const |
| StaticMapTree (StaticMapTree const &right)=delete | |
| StaticMapTree & | operator= (StaticMapTree const &right)=delete |
Private Attributes | |
| uint32 | iMapID |
| bool | iIsTiled |
| BIH | iTree |
| ModelInstance * | iTreeValues |
| uint32 | iNTreeValues |
| loadedTileMap | iLoadedTiles |
| loadedSpawnMap | iLoadedSpawns |
| std::string | iBasePath |
|
private |
|
private |
| VMAP::StaticMapTree::StaticMapTree | ( | uint32 | mapID, |
| const std::string & | basePath | ||
| ) |
Definition at line 90 of file MapTree.cpp.
References iBasePath.
| VMAP::StaticMapTree::~StaticMapTree | ( | ) |
Make sure to call unloadMap() to unregister acquired model references before destroying.
Definition at line 102 of file MapTree.cpp.
References iTreeValues.
|
privatedelete |
|
static |
Definition at line 207 of file MapTree.cpp.
References VMAP::FileNotFound, VMAP::VMapManager2::getMapFileName(), getTileFileName(), VMAP::readChunk(), VMAP::Success, VMAP::VersionMismatch, and VMAP::VMAP_MAGIC.
Referenced by VMAP::VMapManager2::existsMap().
| float VMAP::StaticMapTree::getHeight | ( | const G3D::Vector3 & | pPos, |
| float | maxSearchDist | ||
| ) | const |
Definition at line 193 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 112 of file MapTree.cpp.
References VMAP::MapRayCallback::didHit(), BIH::intersectRay(), iTree, and iTreeValues.
Referenced by getHeight(), getObjectHitPos(), and isInLineOfSight().
| bool VMAP::StaticMapTree::GetLocationInfo | ( | const G3D::Vector3 & | pos, |
| LocationInfo & | info | ||
| ) | const |
Definition at line 83 of file MapTree.cpp.
References BIH::intersectPoint(), iTree, iTreeValues, and VMAP::LocationInfoCallback::result.
| void VMAP::StaticMapTree::getModelInstances | ( | ModelInstance *& | models, |
| uint32 & | count | ||
| ) |
Definition at line 450 of file MapTree.cpp.
References iNTreeValues, and iTreeValues.
| bool VMAP::StaticMapTree::getObjectHitPos | ( | const G3D::Vector3 & | pos1, |
| const G3D::Vector3 & | 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 148 of file MapTree.cpp.
References ASSERT, getIntersectionTime(), and VMAP::Nothing.
|
static |
Definition at line 73 of file MapTree.cpp.
Referenced by CanLoadMap(), LoadMapTile(), and UnloadMapTile().
| bool VMAP::StaticMapTree::InitMap | ( | const std::string & | fname, |
| VMapManager2 * | vm | ||
| ) |
Definition at line 246 of file MapTree.cpp.
References VMAP::VMapManager2::acquireModelInstance(), VMAP::ModelSpawn::flags, iBasePath, iIsTiled, iLoadedSpawns, iNTreeValues, iTree, iTreeValues, VMAP::ModelSpawn::name, BIH::primCount(), VMAP::readChunk(), BIH::readFromFile(), VMAP::ModelSpawn::readFromFile(), TC_LOG_DEBUG, TC_LOG_ERROR, and VMAP::VMAP_MAGIC.
Referenced by VMAP::VMapManager2::_loadMap().
| bool VMAP::StaticMapTree::isInLineOfSight | ( | const G3D::Vector3 & | pos1, |
| const G3D::Vector3 & | pos2, | ||
| ModelIgnoreFlags | ignoreFlags | ||
| ) | const |
Definition at line 123 of file MapTree.cpp.
References ASSERT, and getIntersectionTime().
| bool VMAP::StaticMapTree::LoadMapTile | ( | uint32 | tileX, |
| uint32 | tileY, | ||
| VMapManager2 * | vm | ||
| ) |
Definition at line 311 of file MapTree.cpp.
References VMAP::VMapManager2::acquireModelInstance(), VMAP::ModelSpawn::flags, getTileFileName(), iBasePath, VMAP::ModelSpawn::ID, iIsTiled, iLoadedSpawns, iLoadedTiles, iMapID, iNTreeValues, iTreeValues, VMAP::ModelSpawn::name, packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), TC_LOG_DEBUG, TC_LOG_ERROR, TC_METRIC_EVENT, and VMAP::VMAP_MAGIC.
Referenced by VMAP::VMapManager2::_loadMap().
|
inline |
|
privatedelete |
Definition at line 72 of file MapTree.h.
Referenced by VMAP::TileAssembler::convertWorld2(), MMAP::MapBuilder::discoverTiles(), LoadMapTile(), VMAP::TileAssembler::readMapSpawns(), and UnloadMapTile().
| void VMAP::StaticMapTree::UnloadMap | ( | VMapManager2 * | vm | ) |
Definition at line 297 of file MapTree.cpp.
References iLoadedSpawns, iLoadedTiles, iTreeValues, VMAP::ModelSpawn::name, VMAP::VMapManager2::releaseModelInstance(), and VMAP::ModelInstance::setUnloaded().
| void VMAP::StaticMapTree::UnloadMapTile | ( | uint32 | tileX, |
| uint32 | tileY, | ||
| VMapManager2 * | vm | ||
| ) |
Definition at line 393 of file MapTree.cpp.
References getTileFileName(), iBasePath, VMAP::ModelSpawn::ID, iLoadedSpawns, iLoadedTiles, iMapID, iTreeValues, VMAP::ModelSpawn::name, packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), VMAP::VMapManager2::releaseModelInstance(), VMAP::ModelInstance::setUnloaded(), TC_LOG_ERROR, TC_METRIC_EVENT, and VMAP::VMAP_MAGIC.
|
inlinestatic |
Definition at line 73 of file MapTree.h.
Referenced by MMAP::MapBuilder::buildMap(), MMAP::MapBuilder::buildNavMesh(), and VMAP::TileAssembler::convertWorld2().
|
private |
Definition at line 65 of file MapTree.h.
Referenced by InitMap(), LoadMapTile(), StaticMapTree(), and UnloadMapTile().
|
private |
Definition at line 54 of file MapTree.h.
Referenced by InitMap(), and LoadMapTile().
|
private |
Definition at line 64 of file MapTree.h.
Referenced by InitMap(), LoadMapTile(), UnloadMap(), and UnloadMapTile().
|
private |
Definition at line 62 of file MapTree.h.
Referenced by LoadMapTile(), UnloadMap(), and UnloadMapTile().
|
private |
Definition at line 53 of file MapTree.h.
Referenced by LoadMapTile(), and UnloadMapTile().
|
private |
Definition at line 57 of file MapTree.h.
Referenced by getModelInstances(), InitMap(), and LoadMapTile().
|
private |
Definition at line 55 of file MapTree.h.
Referenced by getIntersectionTime(), GetLocationInfo(), and InitMap().
|
private |
Definition at line 56 of file MapTree.h.
Referenced by getIntersectionTime(), GetLocationInfo(), getModelInstances(), InitMap(), LoadMapTile(), UnloadMap(), UnloadMapTile(), and ~StaticMapTree().