TrinityCore
MMAP::TerrainBuilder Class Reference

#include <TerrainBuilder.h>

Public Member Functions

 TerrainBuilder (bool skipLiquid)
 
 ~TerrainBuilder ()
 
void loadMap (uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData)
 
bool loadVMap (uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData)
 
void loadOffMeshConnections (uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, std::vector< OffMeshData > const &offMeshConnections)
 
bool usesLiquids () const
 

Static Public Member Functions

static void transform (std::vector< G3D::Vector3 > const &source, std::vector< G3D::Vector3 > &transformed, float scale, G3D::Matrix3 const &rotation, G3D::Vector3 const &position)
 
static void copyVertices (std::vector< G3D::Vector3 > const &source, G3D::Array< float > &dest)
 
static void copyIndices (std::vector< VMAP::MeshTriangle > const &source, G3D::Array< int > &dest, int offset, bool flip)
 
static void copyIndices (G3D::Array< int > const &source, G3D::Array< int > &dest, int offset)
 
static void cleanVertices (G3D::Array< float > &verts, G3D::Array< int > &tris)
 

Private Member Functions

bool loadMap (uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, Spot portion)
 Loads a portion of a map's terrain. More...
 
void getLoopVars (Spot portion, int &loopStart, int &loopEnd, int &loopInc)
 Sets loop variables for selecting only certain parts of a map's terrain. More...
 
bool loadHeightMap (uint32 mapID, uint32 tileX, uint32 tileY, G3D::Array< float > &vertices, G3D::Array< int > &triangles, Spot portion)
 Load the map terrain from file. More...
 
void getHeightCoord (int index, Grid grid, float xOffset, float yOffset, float *coord, float *v)
 Get the vector coordinate for a specific position. More...
 
void getHeightTriangle (int square, Spot triangle, int *indices, bool liquid=false)
 Get the triangle's vector indices for a specific position. More...
 
bool isHole (int square, uint8 const holes[16][16][8])
 Determines if the specific position's triangles should be rendered. More...
 
void getLiquidCoord (int index, int index2, float xOffset, float yOffset, float *coord, float *v)
 Get the liquid vector coordinate for a specific position. More...
 
map_liquidHeaderTypeFlags getLiquidType (int square, map_liquidHeaderTypeFlags const (&liquid_type)[16][16])
 Get the liquid type for a specific position. More...
 
 TerrainBuilder ()=delete
 
 TerrainBuilder (TerrainBuilder const &tb)=delete
 

Private Attributes

bool m_skipLiquid
 Controls whether liquids are loaded. More...
 

Detailed Description

Definition at line 91 of file TerrainBuilder.h.

Constructor & Destructor Documentation

◆ TerrainBuilder() [1/3]

MMAP::TerrainBuilder::TerrainBuilder ( bool  skipLiquid)

Definition at line 31 of file TerrainBuilder.cpp.

◆ ~TerrainBuilder()

MMAP::TerrainBuilder::~TerrainBuilder ( )

Definition at line 32 of file TerrainBuilder.cpp.

◆ TerrainBuilder() [2/3]

MMAP::TerrainBuilder::TerrainBuilder ( )
privatedelete

◆ TerrainBuilder() [3/3]

MMAP::TerrainBuilder::TerrainBuilder ( TerrainBuilder const &  tb)
privatedelete

Member Function Documentation

◆ cleanVertices()

void MMAP::TerrainBuilder::cleanVertices ( G3D::Array< float > &  verts,
G3D::Array< int > &  tris 
)
static

Definition at line 795 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ copyIndices() [1/2]

void MMAP::TerrainBuilder::copyIndices ( G3D::Array< int > const &  source,
G3D::Array< int > &  dest,
int  offset 
)
static

Definition at line 786 of file TerrainBuilder.cpp.

◆ copyIndices() [2/2]

void MMAP::TerrainBuilder::copyIndices ( std::vector< VMAP::MeshTriangle > const &  source,
G3D::Array< int > &  dest,
int  offset,
bool  flip 
)
static

Definition at line 762 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ copyVertices()

void MMAP::TerrainBuilder::copyVertices ( std::vector< G3D::Vector3 > const &  source,
G3D::Array< float > &  dest 
)
static

Definition at line 750 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ getHeightCoord()

void MMAP::TerrainBuilder::getHeightCoord ( int  index,
Grid  grid,
float  xOffset,
float  yOffset,
float *  coord,
float *  v 
)
private

Get the vector coordinate for a specific position.

Definition at line 485 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ getHeightTriangle()

void MMAP::TerrainBuilder::getHeightTriangle ( int  square,
Spot  triangle,
int *  indices,
bool  liquid = false 
)
private

Get the triangle's vector indices for a specific position.

Definition at line 505 of file TerrainBuilder.cpp.

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

◆ getLiquidCoord()

void MMAP::TerrainBuilder::getLiquidCoord ( int  index,
int  index2,
float  xOffset,
float  yOffset,
float *  coord,
float *  v 
)
private

Get the liquid vector coordinate for a specific position.

Definition at line 552 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ getLiquidType()

map_liquidHeaderTypeFlags MMAP::TerrainBuilder::getLiquidType ( int  square,
map_liquidHeaderTypeFlags const (&)  liquid_type[16][16] 
)
private

Get the liquid type for a specific position.

Definition at line 575 of file TerrainBuilder.cpp.

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

◆ getLoopVars()

void MMAP::TerrainBuilder::getLoopVars ( Spot  portion,
int &  loopStart,
int &  loopEnd,
int &  loopInc 
)
private

Sets loop variables for selecting only certain parts of a map's terrain.

Definition at line 35 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ isHole()

bool MMAP::TerrainBuilder::isHole ( int  square,
uint8 const  holes[16][16][8] 
)
private

Determines if the specific position's triangles should be rendered.

Definition at line 562 of file TerrainBuilder.cpp.

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

◆ loadHeightMap()

bool MMAP::TerrainBuilder::loadHeightMap ( uint32  mapID,
uint32  tileX,
uint32  tileY,
G3D::Array< float > &  vertices,
G3D::Array< int > &  triangles,
Spot  portion 
)
private

Load the map terrain from file.

◆ loadMap() [1/2]

void MMAP::TerrainBuilder::loadMap ( uint32  mapID,
uint32  tileX,
uint32  tileY,
MeshData meshData 
)

Definition at line 68 of file TerrainBuilder.cpp.

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

◆ loadMap() [2/2]

bool MMAP::TerrainBuilder::loadMap ( uint32  mapID,
uint32  tileX,
uint32  tileY,
MeshData meshData,
Spot  portion 
)
private

Loads a portion of a map's terrain.

Definition at line 80 of file TerrainBuilder.cpp.

+ Here is the call graph for this function:

◆ loadOffMeshConnections()

void MMAP::TerrainBuilder::loadOffMeshConnections ( uint32  mapID,
uint32  tileX,
uint32  tileY,
MeshData meshData,
std::vector< OffMeshData > const &  offMeshConnections 
)

Definition at line 838 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ loadVMap()

bool MMAP::TerrainBuilder::loadVMap ( uint32  mapID,
uint32  tileX,
uint32  tileY,
MeshData meshData 
)

Definition at line 586 of file TerrainBuilder.cpp.

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

◆ transform()

void MMAP::TerrainBuilder::transform ( std::vector< G3D::Vector3 > const &  source,
std::vector< G3D::Vector3 > &  transformed,
float  scale,
G3D::Matrix3 const &  rotation,
G3D::Vector3 const &  position 
)
static

Definition at line 736 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ usesLiquids()

bool MMAP::TerrainBuilder::usesLiquids ( ) const
inline

Definition at line 101 of file TerrainBuilder.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_skipLiquid

bool MMAP::TerrainBuilder::m_skipLiquid
private

Controls whether liquids are loaded.

Definition at line 118 of file TerrainBuilder.h.


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