TrinityCore
GridMap Class Reference

#include <GridMap.h>

Public Types

enum class  LoadResult { Ok , FileDoesNotExist , InvalidFile }
 

Public Member Functions

 GridMap ()
 
 ~GridMap ()
 
LoadResult loadData (char const *filename)
 
void unloadData ()
 
uint16 getArea (float x, float y) const
 
float getHeight (float x, float y) const
 
float getMinHeight (float x, float y) const
 
float getLiquidLevel (float x, float y) const
 
ZLiquidStatus GetLiquidStatus (float x, float y, float z, Optional< map_liquidHeaderTypeFlags > ReqLiquidType, LiquidData *data=nullptr, float collisionHeight=2.03128f) const
 

Private Types

typedef float(GridMap::* GetHeightPtr) (float x, float y) const
 

Private Member Functions

bool loadAreaData (FILE *in, uint32 offset, uint32 size)
 
bool loadHeightData (FILE *in, uint32 offset, uint32 size)
 
bool loadLiquidData (FILE *in, uint32 offset, uint32 size)
 
bool loadHolesData (FILE *in, uint32 offset, uint32 size)
 
bool isHole (int row, int col) const
 
float getHeightFromFloat (float x, float y) const
 
float getHeightFromUint16 (float x, float y) const
 
float getHeightFromUint8 (float x, float y) const
 
float getHeightFromFlat (float x, float y) const
 

Private Attributes

uint32 _flags
 
union {
   float *   m_V9
 
   uint16 *   m_uint16_V9
 
   uint8 *   m_uint8_V9
 
}; 
 
union {
   float *   m_V8
 
   uint16 *   m_uint16_V8
 
   uint8 *   m_uint8_V8
 
}; 
 
G3D::Plane * _minHeightPlanes
 
float _gridHeight
 
float _gridIntHeightMultiplier
 
uint16_areaMap
 
float _liquidLevel
 
uint16_liquidEntry
 
map_liquidHeaderTypeFlags_liquidFlags
 
float * _liquidMap
 
uint16 _gridArea
 
uint16 _liquidGlobalEntry
 
map_liquidHeaderTypeFlags _liquidGlobalFlags
 
uint8 _liquidOffX
 
uint8 _liquidOffY
 
uint8 _liquidWidth
 
uint8 _liquidHeight
 
uint8_holes
 
GetHeightPtr _gridGetHeight
 

Detailed Description

Definition at line 30 of file GridMap.h.

Member Typedef Documentation

◆ GetHeightPtr

typedef float(GridMap::* GridMap::GetHeightPtr) (float x, float y) const
private

Definition at line 75 of file GridMap.h.

Member Enumeration Documentation

◆ LoadResult

enum class GridMap::LoadResult
strong
Enumerator
Ok 
FileDoesNotExist 
InvalidFile 

Definition at line 86 of file GridMap.h.

Constructor & Destructor Documentation

◆ GridMap()

GridMap::GridMap ( )

Definition at line 28 of file GridMap.cpp.

+ Here is the call graph for this function:

◆ ~GridMap()

GridMap::~GridMap ( )

Definition at line 55 of file GridMap.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ getArea()

uint16 GridMap::getArea ( float  x,
float  y 
) const

Definition at line 292 of file GridMap.cpp.

+ Here is the caller graph for this function:

◆ getHeight()

float GridMap::getHeight ( float  x,
float  y 
) const
inline

Definition at line 97 of file GridMap.h.

+ Here is the caller graph for this function:

◆ getHeightFromFlat()

float GridMap::getHeightFromFlat ( float  x,
float  y 
) const
private

Definition at line 304 of file GridMap.cpp.

+ Here is the caller graph for this function:

◆ getHeightFromFloat()

float GridMap::getHeightFromFloat ( float  x,
float  y 
) const
private

Definition at line 309 of file GridMap.cpp.

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

◆ getHeightFromUint16()

float GridMap::getHeightFromUint16 ( float  x,
float  y 
) const
private

Definition at line 464 of file GridMap.cpp.

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

◆ getHeightFromUint8()

float GridMap::getHeightFromUint8 ( float  x,
float  y 
) const
private

Definition at line 394 of file GridMap.cpp.

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

◆ getLiquidLevel()

float GridMap::getLiquidLevel ( float  x,
float  y 
) const

Definition at line 577 of file GridMap.cpp.

◆ GetLiquidStatus()

ZLiquidStatus GridMap::GetLiquidStatus ( float  x,
float  y,
float  z,
Optional< map_liquidHeaderTypeFlags ReqLiquidType,
LiquidData data = nullptr,
float  collisionHeight = 2.03128f 
) const

Definition at line 599 of file GridMap.cpp.

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

◆ getMinHeight()

float GridMap::getMinHeight ( float  x,
float  y 
) const

Definition at line 547 of file GridMap.cpp.

+ Here is the call graph for this function:

◆ isHole()

bool GridMap::isHole ( int  row,
int  col 
) const
private

Definition at line 534 of file GridMap.cpp.

+ Here is the caller graph for this function:

◆ loadAreaData()

bool GridMap::loadAreaData ( FILE *  in,
uint32  offset,
uint32  size 
)
private

Definition at line 138 of file GridMap.cpp.

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

◆ loadData()

GridMap::LoadResult GridMap::loadData ( char const *  filename)

Definition at line 60 of file GridMap.cpp.

+ Here is the call graph for this function:

◆ loadHeightData()

bool GridMap::loadHeightData ( FILE *  in,
uint32  offset,
uint32  size 
)
private

Definition at line 156 of file GridMap.cpp.

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

◆ loadHolesData()

bool GridMap::loadHolesData ( FILE *  in,
uint32  offset,
uint32  size 
)
private

Definition at line 280 of file GridMap.cpp.

+ Here is the caller graph for this function:

◆ loadLiquidData()

bool GridMap::loadLiquidData ( FILE *  in,
uint32  offset,
uint32  size 
)
private

Definition at line 245 of file GridMap.cpp.

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

◆ unloadData()

void GridMap::unloadData ( )

Definition at line 117 of file GridMap.cpp.

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

Member Data Documentation

◆ 

union { ... } GridMap::@317

◆ 

union { ... } GridMap::@319

◆ _areaMap

uint16* GridMap::_areaMap
private

Definition at line 51 of file GridMap.h.

◆ _flags

uint32 GridMap::_flags
private

Definition at line 32 of file GridMap.h.

◆ _gridArea

uint16 GridMap::_gridArea
private

Definition at line 58 of file GridMap.h.

◆ _gridGetHeight

GetHeightPtr GridMap::_gridGetHeight
private

Definition at line 76 of file GridMap.h.

◆ _gridHeight

float GridMap::_gridHeight
private

Definition at line 47 of file GridMap.h.

◆ _gridIntHeightMultiplier

float GridMap::_gridIntHeightMultiplier
private

Definition at line 48 of file GridMap.h.

◆ _holes

uint8* GridMap::_holes
private

Definition at line 66 of file GridMap.h.

◆ _liquidEntry

uint16* GridMap::_liquidEntry
private

Definition at line 55 of file GridMap.h.

◆ _liquidFlags

map_liquidHeaderTypeFlags* GridMap::_liquidFlags
private

Definition at line 56 of file GridMap.h.

◆ _liquidGlobalEntry

uint16 GridMap::_liquidGlobalEntry
private

Definition at line 59 of file GridMap.h.

◆ _liquidGlobalFlags

map_liquidHeaderTypeFlags GridMap::_liquidGlobalFlags
private

Definition at line 60 of file GridMap.h.

◆ _liquidHeight

uint8 GridMap::_liquidHeight
private

Definition at line 64 of file GridMap.h.

◆ _liquidLevel

float GridMap::_liquidLevel
private

Definition at line 54 of file GridMap.h.

◆ _liquidMap

float* GridMap::_liquidMap
private

Definition at line 57 of file GridMap.h.

◆ _liquidOffX

uint8 GridMap::_liquidOffX
private

Definition at line 61 of file GridMap.h.

◆ _liquidOffY

uint8 GridMap::_liquidOffY
private

Definition at line 62 of file GridMap.h.

◆ _liquidWidth

uint8 GridMap::_liquidWidth
private

Definition at line 63 of file GridMap.h.

◆ _minHeightPlanes

G3D::Plane* GridMap::_minHeightPlanes
private

Definition at line 45 of file GridMap.h.

◆ m_uint16_V8

uint16* GridMap::m_uint16_V8

Definition at line 42 of file GridMap.h.

◆ m_uint16_V9

uint16* GridMap::m_uint16_V9

Definition at line 36 of file GridMap.h.

◆ m_uint8_V8

uint8* GridMap::m_uint8_V8

Definition at line 43 of file GridMap.h.

◆ m_uint8_V9

uint8* GridMap::m_uint8_V9

Definition at line 37 of file GridMap.h.

◆ m_V8

float* GridMap::m_V8

Definition at line 41 of file GridMap.h.

◆ m_V9

float* GridMap::m_V9

Definition at line 35 of file GridMap.h.


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