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

#include <MapTree.h>

Public Member Functions

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

Static Public Member Functions

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

Private Types

typedef std::unordered_map< uint32, std::vector< uint32 > > loadedTileMap
 

Private Member Functions

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

Private Attributes

uint32 iMapID
 
BIH iTree
 
std::vector< ModelInstanceiTreeValues
 
loadedTileMap iLoadedTiles
 
std::string iBasePath
 

Detailed Description

Definition at line 49 of file MapTree.h.

Member Typedef Documentation

◆ loadedTileMap

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

Definition at line 51 of file MapTree.h.

Constructor & Destructor Documentation

◆ StaticMapTree() [1/2]

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

Definition at line 79 of file MapTree.cpp.

◆ ~StaticMapTree()

VMAP::StaticMapTree::~StaticMapTree ( )
default

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

◆ StaticMapTree() [2/2]

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

Member Function Documentation

◆ CanLoadMap()

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

Definition at line 228 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 ( G3D::Vector3 const &  pPos,
float  maxSearchDist 
) const

Definition at line 177 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ getIntersectionTime()

bool VMAP::StaticMapTree::getIntersectionTime ( G3D::Ray const &  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 96 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 ( G3D::Vector3 const &  pos,
LocationInfo info 
) const

Definition at line 72 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ getModelInstances()

std::span< ModelInstance const > VMAP::StaticMapTree::getModelInstances ( ) const

Definition at line 404 of file MapTree.cpp.

◆ getObjectHitPos()

bool VMAP::StaticMapTree::getObjectHitPos ( G3D::Vector3 const &  pos1,
G3D::Vector3 const &  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 132 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ InitMap()

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

Definition at line 256 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ isInLineOfSight()

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

Definition at line 107 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ LoadMapTile()

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

Definition at line 288 of file MapTree.cpp.

+ Here is the call graph for this function:

◆ numLoadedTiles()

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

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

+ Here is the caller graph for this function:

◆ UnloadMap()

void VMAP::StaticMapTree::UnloadMap ( )

Definition at line 280 of file MapTree.cpp.

◆ UnloadMapTile()

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

Definition at line 378 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 68 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 61 of file MapTree.h.

◆ iLoadedTiles

loadedTileMap VMAP::StaticMapTree::iLoadedTiles
private

Definition at line 60 of file MapTree.h.

◆ iMapID

uint32 VMAP::StaticMapTree::iMapID
private

Definition at line 53 of file MapTree.h.

◆ iTree

BIH VMAP::StaticMapTree::iTree
private

Definition at line 54 of file MapTree.h.

◆ iTreeValues

std::vector<ModelInstance> VMAP::StaticMapTree::iTreeValues
private

Definition at line 55 of file MapTree.h.


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