AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#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. More... | |
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 | GetAreaInfo (G3D::Vector3 &pos, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const |
bool | GetLocationInfo (const G3D::Vector3 &pos, LocationInfo &info) const |
bool | InitMap (const std::string &fname, VMapMgr2 *vm) |
void | UnloadMap (VMapMgr2 *vm) |
bool | LoadMapTile (uint32 tileX, uint32 tileY, VMapMgr2 *vm) |
void | UnloadMapTile (uint32 tileX, uint32 tileY, VMapMgr2 *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 StopAtFirstHit, ModelIgnoreFlags ignoreFlags) const |
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 | ||
) |
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().
bool VMAP::StaticMapTree::GetAreaInfo | ( | G3D::Vector3 & | pos, |
uint32 & | flags, | ||
int32 & | adtId, | ||
int32 & | rootId, | ||
int32 & | groupId | ||
) | const |
References VMAP::AreaInfo::adtId, VMAP::AreaInfoCallback::aInfo, VMAP::AreaInfo::flags, VMAP::AreaInfo::ground_Z, VMAP::AreaInfo::groupId, BIH::intersectPoint(), iTree, iTreeValues, VMAP::AreaInfo::result, and VMAP::AreaInfo::rootId.
float VMAP::StaticMapTree::getHeight | ( | const G3D::Vector3 & | 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 | ( | const G3D::Vector3 & | 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 | ( | 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
References ASSERT, GetIntersectionTime(), and VMAP::Nothing.
|
static |
Referenced by CanLoadMap(), LoadMapTile(), and UnloadMapTile().
bool VMAP::StaticMapTree::InitMap | ( | const std::string & | fname, |
VMapMgr2 * | vm | ||
) |
References VMAP::VMapMgr2::acquireModelInstance(), VMAP::ModelSpawn::flags, iBasePath, iIsTiled, iLoadedSpawns, iNTreeValues, iTree, iTreeValues, VMAP::ModelSpawn::name, BIH::primCount(), VMAP::readChunk(), BIH::readFromFile(), VMAP::ModelSpawn::readFromFile(), and VMAP::VMAP_MAGIC.
Referenced by VMAP::VMapMgr2::_loadMap().
bool VMAP::StaticMapTree::isInLineOfSight | ( | const G3D::Vector3 & | pos1, |
const G3D::Vector3 & | pos2, | ||
ModelIgnoreFlags | ignoreFlags | ||
) | const |
References ASSERT, and GetIntersectionTime().
References VMAP::VMapMgr2::acquireModelInstance(), VMAP::ModelSpawn::flags, getTileFileName(), iBasePath, VMAP::ModelSpawn::ID, iIsTiled, iLoadedSpawns, iLoadedTiles, iMapID, iNTreeValues, iTreeValues, LOG_DEBUG, LOG_ERROR, METRIC_EVENT, VMAP::ModelSpawn::name, packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), and VMAP::VMAP_MAGIC.
Referenced by VMAP::VMapMgr2::_loadMap().
|
inline |
References iLoadedTiles.
Referenced by VMAP::TileAssembler::convertWorld2(), MMAP::MapBuilder::discoverTiles(), LoadMapTile(), VMAP::TileAssembler::readMapSpawns(), and UnloadMapTile().
void VMAP::StaticMapTree::UnloadMap | ( | VMapMgr2 * | vm | ) |
References iLoadedSpawns, iLoadedTiles, iTreeValues, VMAP::ModelSpawn::name, VMAP::VMapMgr2::releaseModelInstance(), and VMAP::ModelInstance::setUnloaded().
References getTileFileName(), iBasePath, VMAP::ModelSpawn::ID, iLoadedSpawns, iLoadedTiles, iMapID, iTreeValues, LOG_ERROR, METRIC_EVENT, VMAP::ModelSpawn::name, packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), VMAP::VMapMgr2::releaseModelInstance(), VMAP::ModelInstance::setUnloaded(), and VMAP::VMAP_MAGIC.
|
inlinestatic |
Referenced by MMAP::MapBuilder::buildMap(), MMAP::MapBuilder::buildNavMesh(), and VMAP::TileAssembler::convertWorld2().
|
private |
Referenced by InitMap(), LoadMapTile(), StaticMapTree(), and UnloadMapTile().
|
private |
Referenced by InitMap(), isTiled(), and LoadMapTile().
|
private |
Referenced by InitMap(), LoadMapTile(), UnloadMap(), and UnloadMapTile().
|
private |
Referenced by LoadMapTile(), numLoadedTiles(), UnloadMap(), and UnloadMapTile().
|
private |
Referenced by LoadMapTile(), and UnloadMapTile().
|
private |
Referenced by GetModelInstances(), InitMap(), and LoadMapTile().
|
private |
Referenced by GetAreaInfo(), GetIntersectionTime(), GetLocationInfo(), and InitMap().
|
private |
Referenced by GetAreaInfo(), GetIntersectionTime(), GetLocationInfo(), GetModelInstances(), InitMap(), LoadMapTile(), UnloadMap(), UnloadMapTile(), and ~StaticMapTree().