AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "VMapMgr2.h"
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 |
VMapMgr2 () | |
~VMapMgr2 () override | |
void | InitializeThreadUnsafe (const std::vector< uint32 > &mapIds) |
int | loadMap (const char *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 | GetAreaInfo (uint32 pMapId, float x, float y, float &z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const override |
bool | GetLiquidLevel (uint32 pMapId, float x, float y, float z, uint8 reqLiquidType, float &level, float &floor, uint32 &type, uint32 &mogpFlags) const override |
void | GetAreaAndLiquidData (uint32 mapId, float x, float y, float z, uint8 reqLiquidType, AreaAndLiquidData &data) const override |
WorldModel * | acquireModelInstance (const std::string &basepath, const std::string &filename, uint32 flags) |
void | releaseModelInstance (const std::string &filename) |
std::string | getDirFileName (unsigned int mapId, int, int) const override |
LoadResult | existsMap (const char *basePath, unsigned int mapId, int x, int y) override |
void | GetInstanceMapTree (InstanceTreeMap &instanceMapTree) |
Public Member Functions inherited from VMAP::IVMapMgr | |
IVMapMgr () | |
virtual | ~IVMapMgr ()=default |
virtual int | loadMap (const char *pBasePath, unsigned int pMapId, int x, int y)=0 |
virtual LoadResult | existsMap (const char *pBasePath, unsigned int pMapId, int x, int y)=0 |
virtual void | unloadMap (unsigned int pMapId, int x, int y)=0 |
virtual void | unloadMap (unsigned int pMapId)=0 |
virtual bool | isInLineOfSight (unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags)=0 |
virtual float | getHeight (unsigned int pMapId, float x, float y, float z, float maxSearchDist)=0 |
virtual bool | GetObjectHitPos (unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, float &rx, float &ry, float &rz, float pModifyDist)=0 |
virtual bool | processCommand (char *pCommand)=0 |
void | setEnableLineOfSightCalc (bool pVal) |
void | setEnableHeightCalc (bool pVal) |
bool | isLineOfSightCalcEnabled () const |
bool | isHeightCalcEnabled () const |
bool | isMapLoadingEnabled () const |
virtual std::string | getDirFileName (unsigned int pMapId, int x, int y) const =0 |
virtual bool | GetAreaInfo (uint32 pMapId, float x, float y, float &z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const =0 |
virtual bool | GetLiquidLevel (uint32 pMapId, float x, float y, float z, uint8 ReqLiquidType, float &level, float &floor, uint32 &type, uint32 &mogpFlags) const =0 |
virtual void | GetAreaAndLiquidData (uint32 mapId, float x, float y, float z, 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 |
VMAP::VMapMgr2::VMapMgr2 | ( | ) |
References GetLiquidFlagsDummy(), GetLiquidFlagsPtr, IsVMAPDisabledForDummy(), IsVMAPDisabledForPtr, and thread_safe_environment.
|
override |
References iInstanceMapTrees, and iLoadedModelFiles.
|
protected |
References ABORT, getMapFileName(), iInstanceMapTrees, VMAP::StaticMapTree::InitMap(), VMAP::StaticMapTree::LoadMapTile(), and thread_safe_environment.
Referenced by loadMap().
WorldModel * VMAP::VMapMgr2::acquireModelInstance | ( | const std::string & | basepath, |
const std::string & | filename, | ||
uint32 | flags | ||
) |
Critical section, thread safe access to iLoadedModelFiles
References VMAP::WorldModel::Flags, iLoadedModelFiles, LoadedModelFilesLock, LOG_DEBUG, LOG_ERROR, and VMAP::WorldModel::readFile().
Referenced by GameObjectModel::initialize(), VMAP::StaticMapTree::InitMap(), and VMAP::StaticMapTree::LoadMapTile().
Vector3 VMAP::VMapMgr2::convertPositionToInternalRep | ( | float | x, |
float | y, | ||
float | z | ||
) | const |
References MAX_NUMBER_OF_GRIDS, and SIZE_OF_GRIDS.
Referenced by GetAreaAndLiquidData(), GetAreaInfo(), getHeight(), GetLiquidLevel(), GetObjectHitPos(), and isInLineOfSight().
|
overridevirtual |
Implements VMAP::IVMapMgr.
References VMAP::StaticMapTree::CanLoadMap().
|
overridevirtual |
Implements VMAP::IVMapMgr.
References VMAP::ModelSpawn::adtId, VMAP::AreaAndLiquidData::areaInfo, convertPositionToInternalRep(), VMAP::AreaAndLiquidData::floorZ, GetAreaInfo(), GetLiquidFlagsPtr, VMAP::ModelInstance::GetLiquidLevel(), VMAP::GroupModel::GetLiquidType(), GetMapTree(), VMAP::GroupModel::GetMogpFlags(), VMAP::GroupModel::GetWmoID(), VMAP::LocationInfo::ground_Z, VMAP::LocationInfo::hitInstance, VMAP::LocationInfo::hitModel, iInstanceMapTrees, IsVMAPDisabledForPtr, VMAP::AreaAndLiquidData::liquidInfo, VMAP::LocationInfo::rootId, VMAP::VMAP_DISABLE_AREAFLAG, and VMAP::VMAP_DISABLE_LIQUIDSTATUS.
|
overridevirtual |
Query world model area info.
z | gets adjusted to the ground height for which this are info is valid |
Implements VMAP::IVMapMgr.
References convertPositionToInternalRep(), GetMapTree(), iInstanceMapTrees, IsVMAPDisabledForPtr, and VMAP::VMAP_DISABLE_AREAFLAG.
Referenced by GetAreaAndLiquidData().
|
inlineoverridevirtual |
Implements VMAP::IVMapMgr.
References getMapFileName().
|
overridevirtual |
get height or INVALID_HEIGHT if no height available
Implements VMAP::IVMapMgr.
References convertPositionToInternalRep(), GetMapTree(), iInstanceMapTrees, VMAP::IVMapMgr::isHeightCalcEnabled(), IsVMAPDisabledForPtr, VMAP::VMAP_DISABLE_HEIGHT, and VMAP_INVALID_HEIGHT_VALUE.
void VMAP::VMapMgr2::GetInstanceMapTree | ( | InstanceTreeMap & | instanceMapTree | ) |
References iInstanceMapTrees.
Referenced by VMapMgr2().
|
overridevirtual |
Implements VMAP::IVMapMgr.
References ASSERT, convertPositionToInternalRep(), GetLiquidFlagsPtr, VMAP::ModelInstance::GetLiquidLevel(), VMAP::GroupModel::GetLiquidType(), GetMapTree(), VMAP::GroupModel::GetMogpFlags(), VMAP::LocationInfo::ground_Z, VMAP::LocationInfo::hitInstance, VMAP::LocationInfo::hitModel, iInstanceMapTrees, IsVMAPDisabledForPtr, and VMAP::VMAP_DISABLE_LIQUIDSTATUS.
|
static |
References MAP_FILENAME_EXTENSION2.
Referenced by _loadMap(), VMAP::StaticMapTree::CanLoadMap(), and getDirFileName().
|
protected |
References iInstanceMapTrees.
Referenced by GetAreaAndLiquidData(), GetAreaInfo(), getHeight(), GetLiquidLevel(), 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::IVMapMgr.
References convertPositionToInternalRep(), GetMapTree(), iInstanceMapTrees, VMAP::IVMapMgr::isLineOfSightCalcEnabled(), IsVMAPDisabledForPtr, and VMAP::VMAP_DISABLE_LOS.
Referenced by Map::CheckCollisionAndGetValidCoords(), and Spell::SelectImplicitCasterDestTargets().
void VMAP::VMapMgr2::InitializeThreadUnsafe | ( | const std::vector< uint32 > & | mapIds | ) |
References iInstanceMapTrees, and thread_safe_environment.
Referenced by World::SetInitialWorldSettings().
|
overridevirtual |
Implements VMAP::IVMapMgr.
References convertPositionToInternalRep(), GetMapTree(), iInstanceMapTrees, VMAP::IVMapMgr::isLineOfSightCalcEnabled(), IsVMAPDisabledForPtr, and VMAP::VMAP_DISABLE_LOS.
Referenced by VMapMgr2().
|
overridevirtual |
Implements VMAP::IVMapMgr.
References _loadMap(), VMAP::IVMapMgr::isMapLoadingEnabled(), VMAP::VMAP_LOAD_RESULT_ERROR, VMAP::VMAP_LOAD_RESULT_IGNORED, and VMAP::VMAP_LOAD_RESULT_OK.
Referenced by Map::LoadVMap().
|
inlineoverridevirtual |
void VMAP::VMapMgr2::releaseModelInstance | ( | const std::string & | filename | ) |
Critical section, thread safe access to iLoadedModelFiles
References iLoadedModelFiles, LoadedModelFilesLock, LOG_DEBUG, and LOG_ERROR.
Referenced by VMAP::StaticMapTree::UnloadMap(), VMAP::StaticMapTree::UnloadMapTile(), and GameObjectModel::~GameObjectModel().
|
overridevirtual |
Implements VMAP::IVMapMgr.
References iInstanceMapTrees.
|
overridevirtual |
Implements VMAP::IVMapMgr.
References iInstanceMapTrees.
Referenced by Map::UnloadGrid().
GetLiquidFlagsFn VMAP::VMapMgr2::GetLiquidFlagsPtr |
Referenced by GetAreaAndLiquidData(), GetLiquidLevel(), World::SetInitialWorldSettings(), and VMapMgr2().
|
protected |
|
protected |
Referenced by acquireModelInstance(), releaseModelInstance(), and ~VMapMgr2().
IsVMAPDisabledForFn VMAP::VMapMgr2::IsVMAPDisabledForPtr |
|
protected |
Referenced by acquireModelInstance(), and releaseModelInstance().
|
protected |
Referenced by _loadMap(), InitializeThreadUnsafe(), and VMapMgr2().