![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#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, LocationInfo &info) const |
| bool | InitMap (std::string const &fname) |
| void | UnloadMap () |
| bool | LoadMapTile (uint32 tileX, uint32 tileY) |
| void | UnloadMapTile (uint32 tileX, uint32 tileY) |
| 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 (std::string const &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 (G3D::Ray const &pRay, float &pMaxDist, bool StopAtFirstHit, ModelIgnoreFlags ignoreFlags) const |
Private Attributes | |
| uint32 | iMapID |
| bool | iIsTiled |
| BIH | iTree |
| ModelInstance * | iTreeValues |
| uint32 | iNTreeValues |
| loadedTileMap | iLoadedTiles |
| std::string | iBasePath |
|
private |
|
private |
| VMAP::StaticMapTree::StaticMapTree | ( | uint32 | mapID, |
| std::string const & | basePath | ||
| ) |
| VMAP::StaticMapTree::~StaticMapTree | ( | ) |
Make sure to call unloadMap() to unregister acquired model references before destroying.
References iTreeValues.
|
static |
References VMAP::FileNotFound, VMAP::VMapMgr2::getMapFileName(), getTileFileName(), VMAP::readChunk(), VMAP::Success, VMAP::VersionMismatch, and VMAP::VMAP_MAGIC.
Referenced by VMAP::VMapMgr2::existsMap().
| float VMAP::StaticMapTree::getHeight | ( | G3D::Vector3 const & | pPos, |
| float | maxSearchDist | ||
| ) | const |
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;
References VMAP::MapRayCallback::didHit(), BIH::intersectRay(), iTree, and iTreeValues.
Referenced by getHeight(), GetObjectHitPos(), and isInLineOfSight().
| bool VMAP::StaticMapTree::GetLocationInfo | ( | G3D::Vector3 const & | pos, |
| LocationInfo & | info | ||
| ) | const |
References BIH::intersectPoint(), iTree, iTreeValues, and VMAP::LocationInfoCallback::result.
| void VMAP::StaticMapTree::GetModelInstances | ( | ModelInstance *& | models, |
| uint32 & | count | ||
| ) |
References iNTreeValues, and 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
References ASSERT, GetIntersectionTime(), and VMAP::Nothing.
|
static |
Referenced by CanLoadMap(), and LoadMapTile().
| bool VMAP::StaticMapTree::InitMap | ( | std::string const & | fname | ) |
References VMAP::ModelSpawn::flags, iBasePath, iIsTiled, iNTreeValues, iTree, iTreeValues, VMAP::ModelSpawn::name, BIH::primCount(), VMAP::readChunk(), BIH::readFromFile(), VMAP::ModelSpawn::readFromFile(), sWorldModelStore, and VMAP::VMAP_MAGIC.
| bool VMAP::StaticMapTree::isInLineOfSight | ( | G3D::Vector3 const & | pos1, |
| G3D::Vector3 const & | pos2, | ||
| ModelIgnoreFlags | ignoreFlags | ||
| ) | const |
References ASSERT, and GetIntersectionTime().
References VMAP::ModelSpawn::flags, getTileFileName(), iBasePath, VMAP::ModelSpawn::ID, iIsTiled, iLoadedTiles, iMapID, iNTreeValues, iTreeValues, LOG_DEBUG, LOG_ERROR, METRIC_EVENT, VMAP::ModelSpawn::name, packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), sWorldModelStore, and VMAP::VMAP_MAGIC.
|
inline |
References iLoadedTiles.
Referenced by VMAP::TileAssembler::convertWorld2(), MMAP::MapBuilder::discoverTiles(), LoadMapTile(), VMAP::TileAssembler::readMapSpawns(), and UnloadMapTile().
| void VMAP::StaticMapTree::UnloadMap | ( | ) |
References iLoadedTiles.
References iLoadedTiles, iMapID, LOG_ERROR, METRIC_EVENT, and packTileID().
|
inlinestatic |
Referenced by MMAP::MapBuilder::buildMap(), MMAP::MapBuilder::buildNavMesh(), and VMAP::TileAssembler::convertWorld2().
|
private |
Referenced by InitMap(), LoadMapTile(), and StaticMapTree().
|
private |
Referenced by InitMap(), isTiled(), and LoadMapTile().
|
private |
Referenced by LoadMapTile(), numLoadedTiles(), UnloadMap(), and UnloadMapTile().
|
private |
Referenced by LoadMapTile(), and UnloadMapTile().
|
private |
Referenced by GetModelInstances(), InitMap(), and LoadMapTile().
|
private |
Referenced by GetIntersectionTime(), GetLocationInfo(), and InitMap().
|
private |
Referenced by GetIntersectionTime(), GetLocationInfo(), GetModelInstances(), InitMap(), LoadMapTile(), and ~StaticMapTree().