TrinityCore
Loading...
Searching...
No Matches
MMAP::TerrainBuilder Class Reference

#include <TerrainBuilder.h>

Public Member Functions

 TerrainBuilder (bool skipLiquid)
 
 ~TerrainBuilder ()
 
 TerrainBuilder (TerrainBuilder const &tb)=delete
 
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, char const *offMeshFilePath)
 
bool usesLiquids () const
 

Static Public Member Functions

static void transform (std::vector< G3D::Vector3 > &original, std::vector< G3D::Vector3 > &transformed, float scale, G3D::Matrix3 &rotation, G3D::Vector3 &position)
 
static void copyVertices (std::vector< G3D::Vector3 > &source, G3D::Array< float > &dest)
 
static void copyIndices (std::vector< VMAP::MeshTriangle > &source, G3D::Array< int > &dest, int offest, bool flip)
 
static void copyIndices (G3D::Array< int > &src, 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.
 
void getLoopVars (Spot portion, int &loopStart, int &loopEnd, int &loopInc)
 Sets loop variables for selecting only certain parts of a map's terrain.
 
void getHeightCoord (int index, Grid grid, float xOffset, float yOffset, float *coord, float *v)
 Get the vector coordinate for a specific position.
 
void getHeightTriangle (int square, Spot triangle, int *indices, bool liquid=false)
 Get the triangle's vector indices for a specific position.
 
bool isHole (int square, const uint16 holes[16][16])
 Determines if the specific position's triangles should be rendered.
 
void getLiquidCoord (int index, int index2, float xOffset, float yOffset, float *coord, float *v)
 Get the liquid vector coordinate for a specific position.
 
uint8 getLiquidType (int square, const uint8 liquid_type[16][16])
 Get the liquid type for a specific position.
 

Private Attributes

bool m_skipLiquid
 Controls whether liquids are loaded.
 

Detailed Description

Definition at line 77 of file TerrainBuilder.h.

Constructor & Destructor Documentation

◆ TerrainBuilder() [1/2]

MMAP::TerrainBuilder::TerrainBuilder ( bool  skipLiquid)

Definition at line 88 of file TerrainBuilder.cpp.

◆ ~TerrainBuilder()

MMAP::TerrainBuilder::~TerrainBuilder ( )

Definition at line 89 of file TerrainBuilder.cpp.

◆ TerrainBuilder() [2/2]

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

Member Function Documentation

◆ cleanVertices()

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

Definition at line 845 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ copyIndices() [1/2]

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

Definition at line 837 of file TerrainBuilder.cpp.

◆ copyIndices() [2/2]

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

Definition at line 814 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ copyVertices()

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

Definition at line 803 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 530 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 550 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 597 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ getLiquidType()

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

Get the liquid type for a specific position.

Definition at line 625 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 92 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ isHole()

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

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

Definition at line 610 of file TerrainBuilder.cpp.

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

◆ loadMap() [1/2]

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

Definition at line 125 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 137 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,
char const *  offMeshFilePath 
)

Definition at line 888 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 636 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 > &  original,
std::vector< G3D::Vector3 > &  transformed,
float  scale,
G3D::Matrix3 &  rotation,
G3D::Vector3 &  position 
)
static

Definition at line 790 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ usesLiquids()

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

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


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