TrinityCore
VMAP::VMapManager2 Class Reference

#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 InitializeThreadUnsafe (std::unordered_map< uint32, std::vector< uint32 > > const &mapData)
 
LoadResult 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
 
WorldModelacquireModelInstance (std::string const &basepath, std::string const &filename)
 
void releaseModelInstance (std::string const &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)
 
int32 getParentMapId (uint32 mapId) const
 
- Public Member Functions inherited from VMAP::IVMapManager
 IVMapManager ()
 
virtual ~IVMapManager (void)
 
virtual LoadResult loadMap (char const *pBasePath, unsigned int pMapId, int x, int y)=0
 
virtual LoadResult existsMap (char const *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 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

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
 
std::unordered_map< uint32, uint32iParentMapData
 
bool thread_safe_environment
 
std::mutex LoadedModelFilesLock
 

Detailed Description

Definition at line 65 of file VMapManager2.h.

Member Typedef Documentation

◆ GetLiquidFlagsFn

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

Definition at line 122 of file VMapManager2.h.

◆ IsVMAPDisabledForFn

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

Definition at line 125 of file VMapManager2.h.

Constructor & Destructor Documentation

◆ VMapManager2()

VMAP::VMapManager2::VMapManager2 ( )

Definition at line 52 of file VMapManager2.cpp.

+ Here is the call graph for this function:

◆ ~VMapManager2()

VMAP::VMapManager2::~VMapManager2 ( )

Definition at line 59 of file VMapManager2.cpp.

Member Function Documentation

◆ acquireModelInstance()

WorldModel * VMAP::VMapManager2::acquireModelInstance ( std::string const &  basepath,
std::string const &  filename 
)

Critical section, thread safe access to iLoadedModelFiles

Definition at line 270 of file VMapManager2.cpp.

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

◆ convertPositionToInternalRep()

Vector3 VMAP::VMapManager2::convertPositionToInternalRep ( float  x,
float  y,
float  z 
) const

Definition at line 91 of file VMapManager2.cpp.

+ Here is the caller graph for this function:

◆ existsMap()

LoadResult VMAP::VMapManager2::existsMap ( char const *  basePath,
unsigned int  mapId,
int  x,
int  y 
)
overridevirtual

Implements VMAP::IVMapManager.

Definition at line 314 of file VMapManager2.cpp.

+ Here is the call graph for this function:

◆ getAreaAndLiquidData()

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

Definition at line 241 of file VMapManager2.cpp.

+ Here is the call graph for this function:

◆ getDirFileName()

virtual std::string VMAP::VMapManager2::getDirFileName ( unsigned int  mapId,
int  ,
int   
) const
inlineoverridevirtual

Implements VMAP::IVMapManager.

Definition at line 112 of file VMapManager2.h.

◆ getHeight()

float VMAP::VMapManager2::getHeight ( unsigned int  mapId,
float  x,
float  y,
float  z,
float  maxSearchDist 
)
overridevirtual

get height or INVALID_HEIGHT if no height available

Implements VMAP::IVMapManager.

Definition at line 222 of file VMapManager2.cpp.

+ Here is the call graph for this function:

◆ getInstanceMapTree()

void VMAP::VMapManager2::getInstanceMapTree ( InstanceTreeMap instanceMapTree)

Definition at line 319 of file VMapManager2.cpp.

◆ GetLiquidFlagsDummy()

static uint32 VMAP::VMapManager2::GetLiquidFlagsDummy ( uint32  )
inlinestaticprotected

Definition at line 76 of file VMapManager2.h.

+ Here is the caller graph for this function:

◆ getMapFileName()

std::string VMAP::VMapManager2::getMapFileName ( unsigned int  mapId)
static

Definition at line 103 of file VMapManager2.cpp.

+ Here is the caller graph for this function:

◆ GetMapTree()

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

Definition at line 68 of file VMapManager2.cpp.

+ Here is the caller graph for this function:

◆ getObjectHitPos()

bool VMAP::VMapManager2::getObjectHitPos ( unsigned int  mapId,
float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2,
float &  rx,
float &  ry,
float &  rz,
float  modifyDist 
)
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 192 of file VMapManager2.cpp.

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

◆ getParentMapId()

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

Definition at line 324 of file VMapManager2.cpp.

+ Here is the caller graph for this function:

◆ InitializeThreadUnsafe()

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

Definition at line 78 of file VMapManager2.cpp.

+ Here is the caller graph for this function:

◆ isInLineOfSight()

bool VMAP::VMapManager2::isInLineOfSight ( unsigned int  mapId,
float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2,
ModelIgnoreFlags  ignoreFlags 
)
overridevirtual

Implements VMAP::IVMapManager.

Definition at line 171 of file VMapManager2.cpp.

+ Here is the call graph for this function:

◆ IsVMAPDisabledForDummy()

static bool VMAP::VMapManager2::IsVMAPDisabledForDummy ( uint32  ,
uint8   
)
inlinestaticprotected

Definition at line 77 of file VMapManager2.h.

+ Here is the caller graph for this function:

◆ loadMap()

LoadResult VMAP::VMapManager2::loadMap ( char const *  pBasePath,
unsigned int  mapId,
int  x,
int  y 
)
overridevirtual

Implements VMAP::IVMapManager.

Definition at line 112 of file VMapManager2.cpp.

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

◆ processCommand()

bool VMAP::VMapManager2::processCommand ( char *  pCommand)
inlineoverridevirtual

send debug commands

Implements VMAP::IVMapManager.

Definition at line 104 of file VMapManager2.h.

◆ releaseModelInstance()

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

Critical section, thread safe access to iLoadedModelFiles

Definition at line 295 of file VMapManager2.cpp.

+ Here is the caller graph for this function:

◆ unloadMap() [1/2]

void VMAP::VMapManager2::unloadMap ( unsigned int  mapId)
overridevirtual

Implements VMAP::IVMapManager.

Definition at line 157 of file VMapManager2.cpp.

◆ unloadMap() [2/2]

void VMAP::VMapManager2::unloadMap ( unsigned int  mapId,
int  x,
int  y 
)
overridevirtual

Implements VMAP::IVMapManager.

Definition at line 143 of file VMapManager2.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ GetLiquidFlagsPtr

GetLiquidFlagsFn VMAP::VMapManager2::GetLiquidFlagsPtr

Definition at line 123 of file VMapManager2.h.

◆ iInstanceMapTrees

InstanceTreeMap VMAP::VMapManager2::iInstanceMapTrees
protected

Definition at line 70 of file VMapManager2.h.

◆ iLoadedModelFiles

ModelFileMap VMAP::VMapManager2::iLoadedModelFiles
protected

Definition at line 69 of file VMapManager2.h.

◆ iParentMapData

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

Definition at line 71 of file VMapManager2.h.

◆ IsVMAPDisabledForPtr

IsVMAPDisabledForFn VMAP::VMapManager2::IsVMAPDisabledForPtr

Definition at line 126 of file VMapManager2.h.

◆ LoadedModelFilesLock

std::mutex VMAP::VMapManager2::LoadedModelFilesLock
protected

Definition at line 74 of file VMapManager2.h.

◆ thread_safe_environment

bool VMAP::VMapManager2::thread_safe_environment
protected

Definition at line 72 of file VMapManager2.h.


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