Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
VMAP::VMapManager2 Class Reference

#include <VMapManager2.h>

Inheritance diagram for VMAP::VMapManager2:
Collaboration diagram for VMAP::VMapManager2:

Public Member Functions

WorldModelacquireModelInstance (const std::string &basepath, const std::string &filename)
G3D::Vector3 convertPositionToInternalRep (float x, float y, float z) const
virtual bool existsMap (const char *basePath, unsigned int mapId, int x, int y)
bool getAreaInfo (unsigned int pMapId, float x, float y, float &z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const
virtual std::string getDirFileName (unsigned int mapId, int, int) const
float getHeight (unsigned int mapId, float x, float y, float z, float maxSearchDist)
void getInstanceMapTree (InstanceTreeMap &instanceMapTree)
bool GetLiquidLevel (uint32 pMapId, float x, float y, float z, uint8 reqLiquidType, float &level, float &floor, uint32 &type) const
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)
bool isInLineOfSight (unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2)
int loadMap (const char *pBasePath, unsigned int mapId, int x, int y)
bool processCommand (char *)
void releaseModelInstance (const std::string &filename)
void unloadMap (unsigned int mapId)
void unloadMap (unsigned int mapId, int x, int y)
 VMapManager2 ()
 ~VMapManager2 (void)
Public Member Functions inherited from VMAP::IVMapManager
bool isHeightCalcEnabled () const
bool isLineOfSightCalcEnabled () const
bool isMapLoadingEnabled () const
 IVMapManager ()
void setEnableHeightCalc (bool pVal)
void setEnableLineOfSightCalc (bool pVal)
virtual ~IVMapManager (void)

Static Public Member Functions

static std::string getMapFileName (unsigned int mapId)

Protected Member Functions

bool _loadMap (uint32 mapId, const std::string &basePath, uint32 tileX, uint32 tileY)

Protected Attributes

InstanceTreeMap iInstanceMapTrees
ModelFileMap iLoadedModelFiles
std::mutex LoadedModelFilesLock

Detailed Description

Definition at line 56 of file VMapManager2.h.

Constructor & Destructor Documentation

◆ VMapManager2()

VMAP::VMapManager2::VMapManager2 ( )

Definition at line 25 of file VMapManager2.cpp.

◆ ~VMapManager2()

VMAP::VMapManager2::~VMapManager2 ( void )

Definition at line 29 of file VMapManager2.cpp.

References iInstanceMapTrees, and iLoadedModelFiles.

Member Function Documentation

◆ _loadMap()

bool VMAP::VMapManager2::_loadMap ( uint32 mapId,
const std::string & basePath,
uint32 tileX,
uint32 tileY )
protected

Definition at line 77 of file VMapManager2.cpp.

References getMapFileName(), iInstanceMapTrees, and VMAP::StaticMapTree::InitMap().

Referenced by loadMap().

◆ acquireModelInstance()

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

Critical section, thread safe access to iLoadedModelFiles

Definition at line 238 of file VMapManager2.cpp.

References iLoadedModelFiles, LoadedModelFilesLock, VMAP::WorldModel::readFile(), VMAP_DEBUG_LOG, and VMAP_ERROR_LOG.

Referenced by VMAP::StaticMapTree::InitMap(), and VMAP::StaticMapTree::LoadMapTile().

◆ convertPositionToInternalRep()

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

◆ existsMap()

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

Implements VMAP::IVMapManager.

Definition at line 280 of file VMapManager2.cpp.

References VMAP::StaticMapTree::CanLoadMap().

◆ getAreaInfo()

bool VMAP::VMapManager2::getAreaInfo ( unsigned int pMapId,
float x,
float y,
float & z,
uint32 & flags,
int32 & adtId,
int32 & rootId,
int32 & groupId ) const
virtual

Query world model area info.

Parameters
zgets adjusted to the ground height for which this are info is valid

Implements VMAP::IVMapManager.

Definition at line 195 of file VMapManager2.cpp.

References convertPositionToInternalRep(), DISABLE_TYPE_VMAP, iInstanceMapTrees, DisableMgr::IsDisabledFor(), and VMAP_DISABLE_AREAFLAG.

◆ getDirFileName()

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

Implements VMAP::IVMapManager.

Definition at line 97 of file VMapManager2.h.

References getMapFileName().

◆ getHeight()

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

◆ getInstanceMapTree()

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

Definition at line 25 of file VMapExtensions.cpp.

References iInstanceMapTrees.

◆ GetLiquidLevel()

◆ getMapFileName()

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

Definition at line 53 of file VMapManager2.cpp.

References MAP_FILENAME_EXTENSION2.

Referenced by _loadMap(), VMAP::StaticMapTree::CanLoadMap(), and getDirFileName().

◆ 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 )
virtual

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 146 of file VMapManager2.cpp.

References convertPositionToInternalRep(), DISABLE_TYPE_VMAP, iInstanceMapTrees, DisableMgr::IsDisabledFor(), VMAP::IVMapManager::isLineOfSightCalcEnabled(), and VMAP_DISABLE_LOS.

◆ isInLineOfSight()

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

◆ loadMap()

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

◆ processCommand()

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

send debug commands

Implements VMAP::IVMapManager.

Definition at line 88 of file VMapManager2.h.

◆ releaseModelInstance()

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

Critical section, thread safe access to iLoadedModelFiles

Definition at line 261 of file VMapManager2.cpp.

References iLoadedModelFiles, LoadedModelFilesLock, VMAP_DEBUG_LOG, and VMAP_ERROR_LOG.

Referenced by VMAP::StaticMapTree::UnloadMap(), and VMAP::StaticMapTree::UnloadMapTile().

◆ unloadMap() [1/2]

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

Implements VMAP::IVMapManager.

Definition at line 95 of file VMapManager2.cpp.

References iInstanceMapTrees.

◆ unloadMap() [2/2]

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

Implements VMAP::IVMapManager.

Definition at line 109 of file VMapManager2.cpp.

References iInstanceMapTrees.

Member Data Documentation

◆ iInstanceMapTrees

InstanceTreeMap VMAP::VMapManager2::iInstanceMapTrees
protected

◆ iLoadedModelFiles

ModelFileMap VMAP::VMapManager2::iLoadedModelFiles
protected

Definition at line 60 of file VMapManager2.h.

Referenced by acquireModelInstance(), releaseModelInstance(), and ~VMapManager2().

◆ LoadedModelFilesLock

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

Definition at line 63 of file VMapManager2.h.

Referenced by acquireModelInstance(), and releaseModelInstance().


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