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

#include <TerrainBuilder.h>

Public Member Functions

 TerrainBuilder (boost::filesystem::path const &inputDirectory, bool skipLiquid)
 
void loadMap (uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, VMAP::VMapManager *vmapManager)
 
bool loadVMap (uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, VMAP::VMapManager *vmapManager)
 
void loadVMapModel (VMAP::WorldModel const *worldModel, G3D::Vector3 const &position, G3D::Matrix3 const &rotation, float scale, MeshData &meshData, VMAP::VMapManager *vmapManager)
 
void loadOffMeshConnections (uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, std::vector< OffMeshData > const &offMeshConnections)
 
bool usesLiquids () const
 

Static Public Member Functions

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

Private Member Functions

bool loadMap (uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, VMAP::VMapManager *vmapManager, Spot portion)
 Loads a portion of a map's terrain.
 

Static Private Member Functions

static void getLoopVars (Spot portion, int &loopStart, int &loopEnd, int &loopInc)
 Sets loop variables for selecting only certain parts of a map's terrain.
 
static void getHeightCoord (int index, Grid grid, float xOffset, float yOffset, float *coord, float *v)
 Get the vector coordinate for a specific position.
 
static void getHeightTriangle (int square, Spot triangle, int *indices, int offset, bool liquid=false)
 Get the triangle's vector indices for a specific position.
 
static bool isHole (int square, uint8 const (&holes)[16][16][8])
 Determines if the specific position's triangles should be rendered.
 
static void getLiquidCoord (int index, int index2, float xOffset, float yOffset, float *coord, float *v)
 Get the liquid vector coordinate for a specific position.
 
static map_liquidHeaderTypeFlags getLiquidType (int square, map_liquidHeaderTypeFlags const (&liquid_type)[16][16])
 Get the liquid type for a specific position.
 

Private Attributes

boost::filesystem::path m_inputDirectory
 
bool m_skipLiquid
 Controls whether liquids are loaded.
 

Detailed Description

Definition at line 82 of file TerrainBuilder.h.

Constructor & Destructor Documentation

◆ TerrainBuilder()

MMAP::TerrainBuilder::TerrainBuilder ( boost::filesystem::path const &  inputDirectory,
bool  skipLiquid 
)
explicit

Definition at line 34 of file TerrainBuilder.cpp.

Member Function Documentation

◆ cleanVertices()

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

Definition at line 752 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ copyIndices() [1/2]

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

Definition at line 744 of file TerrainBuilder.cpp.

◆ copyIndices() [2/2]

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

Definition at line 721 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 
)
inlinestaticprivate

Get the vector coordinate for a specific position.

Definition at line 469 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ getHeightTriangle()

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

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

Definition at line 489 of file TerrainBuilder.cpp.

+ 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 
)
inlinestaticprivate

Get the liquid vector coordinate for a specific position.

Definition at line 536 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] 
)
inlinestaticprivate

Get the liquid type for a specific position.

Definition at line 559 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ getLoopVars()

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

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

Definition at line 41 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] 
)
inlinestaticprivate

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

Definition at line 546 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ loadMap() [1/2]

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

Definition at line 74 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,
VMAP::VMapManager vmapManager,
Spot  portion 
)
private

Loads a portion of a map's terrain.

Definition at line 86 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 790 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,
VMAP::VMapManager vmapManager 
)

Definition at line 570 of file TerrainBuilder.cpp.

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

◆ loadVMapModel()

void MMAP::TerrainBuilder::loadVMapModel ( VMAP::WorldModel const *  worldModel,
G3D::Vector3 const &  position,
G3D::Matrix3 const &  rotation,
float  scale,
MeshData meshData,
VMAP::VMapManager vmapManager 
)

Definition at line 606 of file TerrainBuilder.cpp.

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

◆ transformVertices()

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

Definition at line 703 of file TerrainBuilder.cpp.

+ Here is the caller graph for this function:

◆ usesLiquids()

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

Definition at line 93 of file TerrainBuilder.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_inputDirectory

boost::filesystem::path MMAP::TerrainBuilder::m_inputDirectory
private

Definition at line 108 of file TerrainBuilder.h.

◆ m_skipLiquid

bool MMAP::TerrainBuilder::m_skipLiquid
private

Controls whether liquids are loaded.

Definition at line 111 of file TerrainBuilder.h.


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