TrinityCore
VMAP::StaticMapTree Class Reference

#include <MapTree.h>

Classes

struct  TileFileOpenResult
 

Public Member Functions

 StaticMapTree (uint32 mapID, const std::string &basePath)
 
 ~StaticMapTree ()
 Make sure to call unloadMap() to unregister acquired model references before destroying. More...
 
bool isInLineOfSight (const G3D::Vector3 &pos1, const G3D::Vector3 &pos2, ModelIgnoreFlags ignoreFlags) const
 
bool getObjectHitPos (const G3D::Vector3 &pos1, const G3D::Vector3 &pos2, G3D::Vector3 &pResultHitPos, float pModifyDist) const
 
float getHeight (const G3D::Vector3 &pPos, float maxSearchDist) const
 
bool GetLocationInfo (const G3D::Vector3 &pos, LocationInfo &info) const
 
LoadResult InitMap (std::string const &fname)
 
void UnloadMap (VMapManager2 *vm)
 
LoadResult LoadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *vm)
 
void UnloadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *vm)
 
uint32 numLoadedTiles () const
 
void getModelInstances (ModelInstance *&models, uint32 &count)
 

Static Public Member Functions

static std::string getTileFileName (uint32 mapID, uint32 tileX, uint32 tileY)
 
static uint32 packTileID (uint32 tileX, uint32 tileY)
 
static void unpackTileID (uint32 ID, uint32 &tileX, uint32 &tileY)
 
static LoadResult CanLoadMap (const std::string &basePath, uint32 mapID, uint32 tileX, uint32 tileY, VMapManager2 *vm)
 

Private Types

typedef std::unordered_map< uint32, bool > loadedTileMap
 
typedef std::unordered_map< uint32, uint32loadedSpawnMap
 

Private Member Functions

bool getIntersectionTime (const G3D::Ray &pRay, float &pMaxDist, bool pStopAtFirstHit, ModelIgnoreFlags ignoreFlags) const
 
 StaticMapTree (StaticMapTree const &right)=delete
 
StaticMapTreeoperator= (StaticMapTree const &right)=delete
 

Static Private Member Functions

static TileFileOpenResult OpenMapTileFile (std::string const &basePath, uint32 mapID, uint32 tileX, uint32 tileY, VMapManager2 *vm)
 

Private Attributes

uint32 iMapID
 
BIH iTree
 
ModelInstanceiTreeValues
 
uint32 iNTreeValues
 
std::unordered_map< uint32, uint32iSpawnIndices
 
loadedTileMap iLoadedTiles
 
std::vector< std::pair< int32, int32 > > iLoadedPrimaryTiles
 
loadedSpawnMap iLoadedSpawns
 
std::string iBasePath
 

Detailed Description

Definition at line 48 of file MapTree.h.

Member Typedef Documentation

◆ loadedSpawnMap

typedef std::unordered_map<uint32, uint32> VMAP::StaticMapTree::loadedSpawnMap
private

Definition at line 51 of file MapTree.h.

◆ loadedTileMap

typedef std::unordered_map<uint32, bool> VMAP::StaticMapTree::loadedTileMap
private

Definition at line 50 of file MapTree.h.

Constructor & Destructor Documentation

◆ StaticMapTree() [1/2]

VMAP::StaticMapTree::StaticMapTree ( uint32  mapID,
const std::string &  basePath 
)

Definition at line 90 of file MapTree.cpp.

◆ ~StaticMapTree()

VMAP::StaticMapTree::~StaticMapTree ( )

Make sure to call unloadMap() to unregister acquired model references before destroying.

Definition at line 101 of file MapTree.cpp.

◆ StaticMapTree() [2/2]

VMAP::StaticMapTree::StaticMapTree ( StaticMapTree const &  right)
privatedelete

Member Function Documentation

◆ CanLoadMap()

LoadResult VMAP::StaticMapTree::CanLoadMap ( const std::string &  basePath,
uint32  mapID,
uint32  tileX,
uint32  tileY,
VMapManager2 vm 
)
static

Definition at line 231 of file MapTree.cpp.

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

◆ getHeight()

float VMAP::StaticMapTree::getHeight ( const G3D::Vector3 &  pPos,
float  maxSearchDist 
) const

Definition at line 193 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ getIntersectionTime()

bool VMAP::StaticMapTree::getIntersectionTime ( const G3D::Ray &  pRay,
float &  pMaxDist,
bool  pStopAtFirstHit,
ModelIgnoreFlags  ignoreFlags 
) const
private

If intersection is found within pMaxDist, sets pMaxDist to intersection distance and returns true. Else, pMaxDist is not modified and returns false;

Definition at line 112 of file MapTree.cpp.

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

◆ GetLocationInfo()

bool VMAP::StaticMapTree::GetLocationInfo ( const G3D::Vector3 &  pos,
LocationInfo info 
) const

Definition at line 83 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ getModelInstances()

void VMAP::StaticMapTree::getModelInstances ( ModelInstance *&  models,
uint32 count 
)

Definition at line 476 of file MapTree.cpp.

◆ getObjectHitPos()

bool VMAP::StaticMapTree::getObjectHitPos ( const G3D::Vector3 &  pos1,
const G3D::Vector3 &  pos2,
G3D::Vector3 &  pResultHitPos,
float  pModifyDist 
) const

When moving from pos1 to pos2 check if we hit an object. Return true and the position if we hit one Return the hit pos or the original dest pos

Definition at line 148 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ getTileFileName()

std::string VMAP::StaticMapTree::getTileFileName ( uint32  mapID,
uint32  tileX,
uint32  tileY 
)
static

Definition at line 73 of file MapTree.cpp.

+ Here is the caller graph for this function:

◆ InitMap()

LoadResult VMAP::StaticMapTree::InitMap ( std::string const &  fname)

Definition at line 275 of file MapTree.cpp.

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

◆ isInLineOfSight()

bool VMAP::StaticMapTree::isInLineOfSight ( const G3D::Vector3 &  pos1,
const G3D::Vector3 &  pos2,
ModelIgnoreFlags  ignoreFlags 
) const

Definition at line 123 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ LoadMapTile()

LoadResult VMAP::StaticMapTree::LoadMapTile ( uint32  tileX,
uint32  tileY,
VMapManager2 vm 
)

Definition at line 335 of file MapTree.cpp.

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

◆ numLoadedTiles()

uint32 VMAP::StaticMapTree::numLoadedTiles ( ) const
inline

Definition at line 97 of file MapTree.h.

◆ OpenMapTileFile()

StaticMapTree::TileFileOpenResult VMAP::StaticMapTree::OpenMapTileFile ( std::string const &  basePath,
uint32  mapID,
uint32  tileX,
uint32  tileY,
VMapManager2 vm 
)
staticprivate

Definition at line 206 of file MapTree.cpp.

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

◆ operator=()

StaticMapTree & VMAP::StaticMapTree::operator= ( StaticMapTree const &  right)
privatedelete

◆ packTileID()

static uint32 VMAP::StaticMapTree::packTileID ( uint32  tileX,
uint32  tileY 
)
inlinestatic

Definition at line 81 of file MapTree.h.

+ Here is the caller graph for this function:

◆ UnloadMap()

void VMAP::StaticMapTree::UnloadMap ( VMapManager2 vm)

Definition at line 320 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ UnloadMapTile()

void VMAP::StaticMapTree::UnloadMapTile ( uint32  tileX,
uint32  tileY,
VMapManager2 vm 
)

Definition at line 420 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ unpackTileID()

static void VMAP::StaticMapTree::unpackTileID ( uint32  ID,
uint32 tileX,
uint32 tileY 
)
inlinestatic

Definition at line 82 of file MapTree.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ iBasePath

std::string VMAP::StaticMapTree::iBasePath
private

Definition at line 66 of file MapTree.h.

◆ iLoadedPrimaryTiles

std::vector<std::pair<int32, int32> > VMAP::StaticMapTree::iLoadedPrimaryTiles
private

Definition at line 63 of file MapTree.h.

◆ iLoadedSpawns

loadedSpawnMap VMAP::StaticMapTree::iLoadedSpawns
private

Definition at line 65 of file MapTree.h.

◆ iLoadedTiles

loadedTileMap VMAP::StaticMapTree::iLoadedTiles
private

Definition at line 62 of file MapTree.h.

◆ iMapID

uint32 VMAP::StaticMapTree::iMapID
private

Definition at line 53 of file MapTree.h.

◆ iNTreeValues

uint32 VMAP::StaticMapTree::iNTreeValues
private

Definition at line 56 of file MapTree.h.

◆ iSpawnIndices

std::unordered_map<uint32, uint32> VMAP::StaticMapTree::iSpawnIndices
private

Definition at line 57 of file MapTree.h.

◆ iTree

BIH VMAP::StaticMapTree::iTree
private

Definition at line 54 of file MapTree.h.

◆ iTreeValues

ModelInstance* VMAP::StaticMapTree::iTreeValues
private

Definition at line 55 of file MapTree.h.


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