TrinityCore
Loading...
Searching...
No Matches
VMAP::VMapManager Class Reference

#include <VMapManager.h>

Public Types

typedef uint32(* GetLiquidFlagsFn) (uint32 liquidType)
 
typedef bool(* IsVMAPDisabledForFn) (uint32 entry, uint8 flags)
 

Public Member Functions

 VMapManager ()
 
 VMapManager (VMapManager const &)=delete
 
 VMapManager (VMapManager &&)=delete
 
VMapManageroperator= (VMapManager const &)=delete
 
VMapManageroperator= (VMapManager &&)=delete
 
 ~VMapManager ()
 
void InitializeThreadUnsafe (std::unordered_map< uint32, std::vector< uint32 > > const &mapData)
 
void InitializeThreadUnsafe (uint32 mapId, int32 parentMapId)
 
void setEnableLineOfSightCalc (bool enableLineOfSightCalc)
 
void setEnableHeightCalc (bool enableHeightCalc)
 
bool isLineOfSightCalcEnabled () const
 
bool isHeightCalcEnabled () const
 
bool isMapLoadingEnabled () const
 
LoadResult loadMap (std::string const &basePath, uint32 mapId, uint32 x, uint32 y)
 
void unloadMap (uint32 mapId, uint32 x, uint32 y)
 
void unloadMap (uint32 mapId)
 
bool isInLineOfSight (uint32 mapId, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags)
 
bool getObjectHitPos (uint32 mapId, float x1, float y1, float z1, float x2, float y2, float z2, float &rx, float &ry, float &rz, float modifyDist)
 
float getHeight (uint32 mapId, float x, float y, float z, float maxSearchDist)
 
bool getAreaAndLiquidData (uint32 mapId, float x, float y, float z, Optional< uint8 > reqLiquidType, AreaAndLiquidData &data) const
 
std::shared_ptr< WorldModelacquireModelInstance (std::string const &basepath, std::string const &filename)
 
void releaseModelInstance (std::string const &filename)
 
LoadResult existsMap (std::string const &basePath, uint32 mapId, uint32 x, uint32 y)
 
std::span< ModelInstance const > getModelsOnMap (uint32 mapId) const
 
int32 getParentMapId (uint32 mapId) const
 

Static Public Member Functions

static std::string getMapFileName (uint32 mapId)
 
static std::string getTileFileName (uint32 mapID, uint32 tileX, uint32 tileY, std::string_view extension)
 
static std::string getDirFileName (uint32 mapId, uint32 x, uint32 y)
 

Public Attributes

GetLiquidFlagsFn GetLiquidFlagsPtr
 
IsVMAPDisabledForFn IsVMAPDisabledForPtr
 
bool LoadPathOnlyModels
 

Protected Member Functions

InstanceTreeMap::const_iterator GetMapTree (uint32 mapId) const
 

Protected Attributes

bool iEnableLineOfSightCalc
 
bool iEnableHeightCalc
 
bool thread_safe_environment
 
ModelFileMap iLoadedModelFiles
 
InstanceTreeMap iInstanceMapTrees
 
std::unordered_map< uint32, uint32iParentMapData
 
std::mutex LoadedModelFilesLock
 

Detailed Description

Definition at line 99 of file VMapManager.h.

Member Typedef Documentation

◆ GetLiquidFlagsFn

typedef uint32(* VMAP::VMapManager::GetLiquidFlagsFn) (uint32 liquidType)

Definition at line 180 of file VMapManager.h.

◆ IsVMAPDisabledForFn

typedef bool(* VMAP::VMapManager::IsVMAPDisabledForFn) (uint32 entry, uint8 flags)

Definition at line 183 of file VMapManager.h.

Constructor & Destructor Documentation

◆ VMapManager() [1/3]

VMAP::VMapManager::VMapManager ( )

Definition at line 58 of file VMapManager.cpp.

◆ VMapManager() [2/3]

VMAP::VMapManager::VMapManager ( VMapManager const &  )
delete

◆ VMapManager() [3/3]

VMAP::VMapManager::VMapManager ( VMapManager &&  )
delete

◆ ~VMapManager()

VMAP::VMapManager::~VMapManager ( )
default

Member Function Documentation

◆ acquireModelInstance()

std::shared_ptr< WorldModel > VMAP::VMapManager::acquireModelInstance ( std::string const &  basepath,
std::string const &  filename 
)

Critical section, thread safe access to iLoadedModelFiles

Definition at line 271 of file VMapManager.cpp.

+ Here is the caller graph for this function:

◆ existsMap()

LoadResult VMAP::VMapManager::existsMap ( std::string const &  basePath,
uint32  mapId,
uint32  x,
uint32  y 
)

Definition at line 308 of file VMapManager.cpp.

+ Here is the call graph for this function:

◆ getAreaAndLiquidData()

bool VMAP::VMapManager::getAreaAndLiquidData ( uint32  mapId,
float  x,
float  y,
float  z,
Optional< uint8 reqLiquidType,
AreaAndLiquidData data 
) const

Query world model area info.

Definition at line 242 of file VMapManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDirFileName()

static std::string VMAP::VMapManager::getDirFileName ( uint32  mapId,
uint32  x,
uint32  y 
)
inlinestatic

Definition at line 170 of file VMapManager.h.

+ Here is the caller graph for this function:

◆ getHeight()

float VMAP::VMapManager::getHeight ( uint32  mapId,
float  x,
float  y,
float  z,
float  maxSearchDist 
)

get height or INVALID_HEIGHT if no height available

Definition at line 223 of file VMapManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMapFileName()

std::string VMAP::VMapManager::getMapFileName ( uint32  mapId)
static

Definition at line 111 of file VMapManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMapTree()

InstanceTreeMap::const_iterator VMAP::VMapManager::GetMapTree ( uint32  mapId) const
protected

Definition at line 70 of file VMapManager.cpp.

+ Here is the caller graph for this function:

◆ getModelsOnMap()

std::span< ModelInstance const > VMAP::VMapManager::getModelsOnMap ( uint32  mapId) const

Definition at line 313 of file VMapManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectHitPos()

bool VMAP::VMapManager::getObjectHitPos ( uint32  mapId,
float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2,
float &  rx,
float &  ry,
float &  rz,
float  modifyDist 
)

test if we hit an object. return true if we hit one. rx, ry, rz will hold the hit position or the dest position, if no intersection was found return a position, that is modifyDist closer to the origin

get the hit position and return true if we hit something otherwise the result pos will be the dest pos

Definition at line 193 of file VMapManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentMapId()

int32 VMAP::VMapManager::getParentMapId ( uint32  mapId) const

Definition at line 322 of file VMapManager.cpp.

+ Here is the caller graph for this function:

◆ getTileFileName()

std::string VMAP::VMapManager::getTileFileName ( uint32  mapID,
uint32  tileX,
uint32  tileY,
std::string_view  extension 
)
static

Definition at line 116 of file VMapManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitializeThreadUnsafe() [1/2]

void VMAP::VMapManager::InitializeThreadUnsafe ( std::unordered_map< uint32, std::vector< uint32 > > const &  mapData)

Definition at line 80 of file VMapManager.cpp.

+ Here is the caller graph for this function:

◆ InitializeThreadUnsafe() [2/2]

void VMAP::VMapManager::InitializeThreadUnsafe ( uint32  mapId,
int32  parentMapId 
)

Definition at line 93 of file VMapManager.cpp.

◆ isHeightCalcEnabled()

bool VMAP::VMapManager::isHeightCalcEnabled ( ) const
inline

Definition at line 144 of file VMapManager.h.

+ Here is the caller graph for this function:

◆ isInLineOfSight()

bool VMAP::VMapManager::isInLineOfSight ( uint32  mapId,
float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2,
ModelIgnoreFlags  ignoreFlags 
)

Definition at line 172 of file VMapManager.cpp.

+ Here is the call graph for this function:

◆ isLineOfSightCalcEnabled()

bool VMAP::VMapManager::isLineOfSightCalcEnabled ( ) const
inline

Definition at line 143 of file VMapManager.h.

+ Here is the caller graph for this function:

◆ isMapLoadingEnabled()

bool VMAP::VMapManager::isMapLoadingEnabled ( ) const
inline

Definition at line 145 of file VMapManager.h.

+ Here is the caller graph for this function:

◆ loadMap()

LoadResult VMAP::VMapManager::loadMap ( std::string const &  basePath,
uint32  mapId,
uint32  x,
uint32  y 
)

Definition at line 121 of file VMapManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

VMapManager & VMAP::VMapManager::operator= ( VMapManager &&  )
delete

◆ operator=() [2/2]

VMapManager & VMAP::VMapManager::operator= ( VMapManager const &  )
delete

◆ releaseModelInstance()

void VMAP::VMapManager::releaseModelInstance ( std::string const &  filename)

Critical section, thread safe access to iLoadedModelFiles

Definition at line 296 of file VMapManager.cpp.

+ Here is the caller graph for this function:

◆ setEnableHeightCalc()

void VMAP::VMapManager::setEnableHeightCalc ( bool  enableHeightCalc)
inline

Enable/disable model height calculation It is enabled by default. If it is enabled in mid game the maps have to loaded manualy

Definition at line 141 of file VMapManager.h.

+ Here is the caller graph for this function:

◆ setEnableLineOfSightCalc()

void VMAP::VMapManager::setEnableLineOfSightCalc ( bool  enableLineOfSightCalc)
inline

Enable/disable LOS calculation It is enabled by default. If it is enabled in mid game the maps have to loaded manualy

Definition at line 135 of file VMapManager.h.

+ Here is the caller graph for this function:

◆ unloadMap() [1/2]

void VMAP::VMapManager::unloadMap ( uint32  mapId)

Definition at line 161 of file VMapManager.cpp.

◆ unloadMap() [2/2]

void VMAP::VMapManager::unloadMap ( uint32  mapId,
uint32  x,
uint32  y 
)

Definition at line 150 of file VMapManager.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ GetLiquidFlagsPtr

GetLiquidFlagsFn VMAP::VMapManager::GetLiquidFlagsPtr

Definition at line 181 of file VMapManager.h.

◆ iEnableHeightCalc

bool VMAP::VMapManager::iEnableHeightCalc
protected

Definition at line 103 of file VMapManager.h.

◆ iEnableLineOfSightCalc

bool VMAP::VMapManager::iEnableLineOfSightCalc
protected

Definition at line 102 of file VMapManager.h.

◆ iInstanceMapTrees

InstanceTreeMap VMAP::VMapManager::iInstanceMapTrees
protected

Definition at line 107 of file VMapManager.h.

◆ iLoadedModelFiles

ModelFileMap VMAP::VMapManager::iLoadedModelFiles
protected

Definition at line 106 of file VMapManager.h.

◆ iParentMapData

std::unordered_map<uint32, uint32> VMAP::VMapManager::iParentMapData
protected

Definition at line 108 of file VMapManager.h.

◆ IsVMAPDisabledForPtr

IsVMAPDisabledForFn VMAP::VMapManager::IsVMAPDisabledForPtr

Definition at line 184 of file VMapManager.h.

◆ LoadedModelFilesLock

std::mutex VMAP::VMapManager::LoadedModelFilesLock
protected

Definition at line 110 of file VMapManager.h.

◆ LoadPathOnlyModels

bool VMAP::VMapManager::LoadPathOnlyModels

Definition at line 186 of file VMapManager.h.

◆ thread_safe_environment

bool VMAP::VMapManager::thread_safe_environment
protected

Definition at line 104 of file VMapManager.h.


The documentation for this class was generated from the following files: