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

#include <MapTree.h>

Public Member Functions

 StaticMapTree (uint32 mapID, const std::string &basePath)
 
 ~StaticMapTree ()
 Make sure to call unloadMap() to unregister acquired model references before destroying.
 
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
 
bool InitMap (const std::string &fname, VMapManager2 *vm)
 
void UnloadMap (VMapManager2 *vm)
 
bool LoadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *vm)
 
void UnloadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *vm)
 
bool isTiled () const
 
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)
 

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
 

Private Attributes

uint32 iMapID
 
bool iIsTiled
 
BIH iTree
 
ModelInstanceiTreeValues
 
uint32 iNTreeValues
 
loadedTileMap iLoadedTiles
 
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 102 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 
)
static

Definition at line 207 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 450 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()

bool VMAP::StaticMapTree::InitMap ( const std::string &  fname,
VMapManager2 vm 
)

Definition at line 246 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:

◆ isTiled()

bool VMAP::StaticMapTree::isTiled ( ) const
inline

Definition at line 88 of file MapTree.h.

◆ LoadMapTile()

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

Definition at line 311 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 89 of file MapTree.h.

◆ operator=()

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

◆ packTileID()

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

Definition at line 72 of file MapTree.h.

+ Here is the caller graph for this function:

◆ UnloadMap()

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

Definition at line 297 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 393 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 73 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 65 of file MapTree.h.

◆ iIsTiled

bool VMAP::StaticMapTree::iIsTiled
private

Definition at line 54 of file MapTree.h.

◆ iLoadedSpawns

loadedSpawnMap VMAP::StaticMapTree::iLoadedSpawns
private

Definition at line 64 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 57 of file MapTree.h.

◆ iTree

BIH VMAP::StaticMapTree::iTree
private

Definition at line 55 of file MapTree.h.

◆ iTreeValues

ModelInstance* VMAP::StaticMapTree::iTreeValues
private

Definition at line 56 of file MapTree.h.


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