![]() |
TrinityCore
|
#include <VMapManager2.h>
Inheritance diagram for VMAP::VMapManager2:Public Types | |
| typedef uint32(* | GetLiquidFlagsFn) (uint32 liquidType) |
| typedef bool(* | IsVMAPDisabledForFn) (uint32 entry, uint8 flags) |
Public Member Functions | |
| G3D::Vector3 | convertPositionToInternalRep (float x, float y, float z) const |
| VMapManager2 () | |
| ~VMapManager2 (void) | |
| void | InitializeThreadUnsafe (const std::vector< uint32 > &mapIds) |
| int | loadMap (char const *pBasePath, unsigned int mapId, int x, int y) override |
| void | unloadMap (unsigned int mapId, int x, int y) override |
| void | unloadMap (unsigned int mapId) override |
| bool | isInLineOfSight (unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags) override |
| bool | getObjectHitPos (unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, float &rx, float &ry, float &rz, float modifyDist) override |
| float | getHeight (unsigned int mapId, float x, float y, float z, float maxSearchDist) override |
| bool | processCommand (char *) override |
| bool | getAreaAndLiquidData (uint32 mapId, float x, float y, float z, Optional< uint8 > reqLiquidType, AreaAndLiquidData &data) const override |
| WorldModel * | acquireModelInstance (const std::string &basepath, const std::string &filename, uint32 flags=0) |
| void | releaseModelInstance (const std::string &filename) |
| virtual std::string | getDirFileName (unsigned int mapId, int, int) const override |
| virtual LoadResult | existsMap (char const *basePath, unsigned int mapId, int x, int y) override |
| void | getInstanceMapTree (InstanceTreeMap &instanceMapTree) |
Public Member Functions inherited from VMAP::IVMapManager | |
| IVMapManager () | |
| virtual | ~IVMapManager (void) |
| void | setEnableLineOfSightCalc (bool pVal) |
| void | setEnableHeightCalc (bool pVal) |
| bool | isLineOfSightCalcEnabled () const |
| bool | isHeightCalcEnabled () const |
| bool | isMapLoadingEnabled () const |
| virtual bool | getAreaAndLiquidData (unsigned int mapId, float x, float y, float z, Optional< uint8 > reqLiquidType, AreaAndLiquidData &data) const =0 |
Static Public Member Functions | |
| static std::string | getMapFileName (unsigned int mapId) |
Public Attributes | |
| GetLiquidFlagsFn | GetLiquidFlagsPtr |
| IsVMAPDisabledForFn | IsVMAPDisabledForPtr |
Protected Member Functions | |
| bool | _loadMap (uint32 mapId, const std::string &basePath, uint32 tileX, uint32 tileY) |
| InstanceTreeMap::const_iterator | GetMapTree (uint32 mapId) const |
Static Protected Member Functions | |
| static uint32 | GetLiquidFlagsDummy (uint32) |
| static bool | IsVMAPDisabledForDummy (uint32, uint8) |
Protected Attributes | |
| ModelFileMap | iLoadedModelFiles |
| InstanceTreeMap | iInstanceMapTrees |
| bool | thread_safe_environment |
| std::mutex | LoadedModelFilesLock |
Definition at line 77 of file VMapManager2.h.
Definition at line 132 of file VMapManager2.h.
Definition at line 135 of file VMapManager2.h.
| VMAP::VMapManager2::VMapManager2 | ( | ) |
Definition at line 35 of file VMapManager2.cpp.
References GetLiquidFlagsDummy(), GetLiquidFlagsPtr, IsVMAPDisabledForDummy(), IsVMAPDisabledForPtr, and thread_safe_environment.
| VMAP::VMapManager2::~VMapManager2 | ( | void | ) |
Definition at line 42 of file VMapManager2.cpp.
References iInstanceMapTrees, and iLoadedModelFiles.
|
protected |
Definition at line 109 of file VMapManager2.cpp.
References ABORT_MSG, getMapFileName(), iInstanceMapTrees, VMAP::StaticMapTree::InitMap(), VMAP::StaticMapTree::LoadMapTile(), and thread_safe_environment.
Referenced by loadMap().
| WorldModel * VMAP::VMapManager2::acquireModelInstance | ( | const std::string & | basepath, |
| const std::string & | filename, | ||
| uint32 | flags = 0 |
||
| ) |
Critical section, thread safe access to iLoadedModelFiles
Definition at line 267 of file VMapManager2.cpp.
References VMAP::WorldModel::Flags, flags, iLoadedModelFiles, LoadedModelFilesLock, VMAP::WorldModel::readFile(), TC_LOG_DEBUG, and TC_LOG_ERROR.
Referenced by GameObjectModel::initialize(), VMAP::StaticMapTree::InitMap(), and VMAP::StaticMapTree::LoadMapTile().
| Vector3 VMAP::VMapManager2::convertPositionToInternalRep | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
Definition at line 63 of file VMapManager2.cpp.
Referenced by getAreaAndLiquidData(), getHeight(), getObjectHitPos(), and isInLineOfSight().
|
overridevirtual |
Implements VMAP::IVMapManager.
Definition at line 312 of file VMapManager2.cpp.
References VMAP::StaticMapTree::CanLoadMap().
|
override |
Definition at line 236 of file VMapManager2.cpp.
References VMAP::ModelSpawn::adtId, VMAP::AreaAndLiquidData::areaInfo, ASSERT, convertPositionToInternalRep(), VMAP::AreaAndLiquidData::floorZ, GetLiquidFlagsPtr, VMAP::ModelInstance::GetLiquidLevel(), VMAP::GroupModel::GetLiquidType(), GetMapTree(), VMAP::GroupModel::GetMogpFlags(), VMAP::GroupModel::GetWmoID(), VMAP::LocationInfo::ground_Z, VMAP::LocationInfo::hitInstance, VMAP::LocationInfo::hitModel, VMAP::ModelSpawn::ID, iInstanceMapTrees, IsVMAPDisabledForPtr, VMAP::AreaAndLiquidData::liquidInfo, VMAP::LocationInfo::rootId, VMAP::VMAP_DISABLE_AREAFLAG, and VMAP::VMAP_DISABLE_LIQUIDSTATUS.
|
inlineoverridevirtual |
Implements VMAP::IVMapManager.
Definition at line 124 of file VMapManager2.h.
|
overridevirtual |
get height or INVALID_HEIGHT if no height available
Implements VMAP::IVMapManager.
Definition at line 217 of file VMapManager2.cpp.
References convertPositionToInternalRep(), GetMapTree(), iInstanceMapTrees, VMAP::IVMapManager::isHeightCalcEnabled(), IsVMAPDisabledForPtr, VMAP::VMAP_DISABLE_HEIGHT, and VMAP_INVALID_HEIGHT_VALUE.
| void VMAP::VMapManager2::getInstanceMapTree | ( | InstanceTreeMap & | instanceMapTree | ) |
Definition at line 317 of file VMapManager2.cpp.
References iInstanceMapTrees.
Definition at line 90 of file VMapManager2.h.
Referenced by VMapManager2().
|
static |
Definition at line 75 of file VMapManager2.cpp.
References MAP_FILENAME_EXTENSION2.
Referenced by _loadMap(), and VMAP::StaticMapTree::CanLoadMap().
|
protected |
Definition at line 98 of file VMapManager2.cpp.
References iInstanceMapTrees.
Referenced by getAreaAndLiquidData(), getHeight(), getObjectHitPos(), and isInLineOfSight().
|
overridevirtual |
fill the hit pos and return true, if an object was hit
get the hit position and return true if we hit something otherwise the result pos will be the dest pos
Implements VMAP::IVMapManager.
Definition at line 187 of file VMapManager2.cpp.
References convertPositionToInternalRep(), GetMapTree(), iInstanceMapTrees, VMAP::IVMapManager::isLineOfSightCalcEnabled(), IsVMAPDisabledForPtr, and VMAP::VMAP_DISABLE_LOS.
Referenced by WorldObject::MovePositionToFirstCollision().
| void VMAP::VMapManager2::InitializeThreadUnsafe | ( | const std::vector< uint32 > & | mapIds | ) |
Definition at line 54 of file VMapManager2.cpp.
References iInstanceMapTrees, and thread_safe_environment.
Referenced by World::SetInitialWorldSettings().
|
overridevirtual |
Implements VMAP::IVMapManager.
Definition at line 164 of file VMapManager2.cpp.
References convertPositionToInternalRep(), GetMapTree(), iInstanceMapTrees, VMAP::IVMapManager::isLineOfSightCalcEnabled(), IsVMAPDisabledForPtr, and VMAP::VMAP_DISABLE_LOS.
Definition at line 91 of file VMapManager2.h.
Referenced by VMapManager2().
|
overridevirtual |
Implements VMAP::IVMapManager.
Definition at line 84 of file VMapManager2.cpp.
References _loadMap(), VMAP::IVMapManager::isMapLoadingEnabled(), VMAP::VMAP_LOAD_RESULT_ERROR, VMAP::VMAP_LOAD_RESULT_IGNORED, and VMAP::VMAP_LOAD_RESULT_OK.
Referenced by Map::LoadVMap(), and MMAP::TerrainBuilder::loadVMap().
|
inlineoverridevirtual |
| void VMAP::VMapManager2::releaseModelInstance | ( | const std::string & | filename | ) |
Critical section, thread safe access to iLoadedModelFiles
Definition at line 293 of file VMapManager2.cpp.
References iLoadedModelFiles, LoadedModelFilesLock, TC_LOG_DEBUG, and TC_LOG_ERROR.
Referenced by VMAP::StaticMapTree::UnloadMap(), VMAP::StaticMapTree::UnloadMapTile(), and GameObjectModel::~GameObjectModel().
|
overridevirtual |
Implements VMAP::IVMapManager.
Definition at line 136 of file VMapManager2.cpp.
References iInstanceMapTrees.
|
overridevirtual |
Implements VMAP::IVMapManager.
Definition at line 150 of file VMapManager2.cpp.
References iInstanceMapTrees.
Referenced by MapInstanced::DestroyInstance(), MMAP::TerrainBuilder::loadVMap(), and Map::UnloadGrid().
| GetLiquidFlagsFn VMAP::VMapManager2::GetLiquidFlagsPtr |
Definition at line 133 of file VMapManager2.h.
Referenced by getAreaAndLiquidData(), World::SetInitialWorldSettings(), and VMapManager2().
|
protected |
Definition at line 82 of file VMapManager2.h.
Referenced by _loadMap(), getAreaAndLiquidData(), getHeight(), getInstanceMapTree(), GetMapTree(), getObjectHitPos(), InitializeThreadUnsafe(), isInLineOfSight(), unloadMap(), unloadMap(), and ~VMapManager2().
|
protected |
Definition at line 81 of file VMapManager2.h.
Referenced by acquireModelInstance(), releaseModelInstance(), and ~VMapManager2().
| IsVMAPDisabledForFn VMAP::VMapManager2::IsVMAPDisabledForPtr |
Definition at line 136 of file VMapManager2.h.
Referenced by getAreaAndLiquidData(), getHeight(), getObjectHitPos(), isInLineOfSight(), World::SetInitialWorldSettings(), and VMapManager2().
|
protected |
Definition at line 85 of file VMapManager2.h.
Referenced by acquireModelInstance(), and releaseModelInstance().
|
protected |
Definition at line 83 of file VMapManager2.h.
Referenced by _loadMap(), InitializeThreadUnsafe(), and VMapManager2().