VOX
A little voxel engine
Loading...
Searching...
No Matches
CreateMeshData Class Reference

#include <CreateMeshData.hpp>

Collaboration diagram for CreateMeshData:
Collaboration graph

Public Types

enum  { POS = 2 , NEUT = 1 , NEG = 0 }
 
enum class  Dimensions { X = 0 , Y = 1 , Z = 2 }
 

Public Member Functions

 CreateMeshData (const glm::ivec3 &pos, const glm::ivec3 &size, ChunkMap &chunk_map)
 Create a Mesh Data object. More...
 
 CreateMeshData (const CreateMeshData &)=delete
 
CreateMeshDataoperator= (const CreateMeshData &)=delete
 
 CreateMeshData (CreateMeshData &&other)
 
CreateMeshDataoperator= (CreateMeshData &&other)
 
 ~CreateMeshData ()
 
void unlock ()
 
BlockInfo::Type getBlock (const int x, const int y, const int z)
 
BlockInfo::Type getBlock (const glm::ivec3 &pos)
 
uint8_t getLight (const int x, const int y, const int z)
 
uint8_t getLight (const glm::ivec3 &pos)
 
void create ()
 
void createFace (const int dim_1, const int dim_2, const glm::ivec3 &start, const glm::ivec3 &max_iter, const std::array< int, 6 > &indices_order, const std::array< int, 6 > &indices_order_fliped, const glm::ivec3 &abs_normal, const int normal_signe, const int face)
 
void createFaceWater (const int dim_1, const int dim_2, const glm::ivec3 &start, const glm::ivec3 &max_iter, const std::array< int, 6 > &indices_order, const std::array< int, 6 > &indices_order_fliped, const glm::ivec3 &abs_normal, const int normal_signe, const int face)
 
std::array< uint8_t, 4 > getAmbientOcclusion (const glm::ivec3 &pos, const int dim_1, const int dim_2)
 
int getAmbientOcclusion (BlockInfo::Type side_1, BlockInfo::Type side_2, BlockInfo::Type corner)
 
std::array< uint8_t, 4 > getLight (const glm::ivec3 &pos, const int dim_1, const int dim_2)
 
uint8_t getLight (uint8_t pos, uint8_t side_1, uint8_t side_2, uint8_t corner)
 
std::shared_ptr< ChunkgetCenterChunk ()
 

Public Attributes

std::vector< std::vector< std::vector< std::shared_ptr< Chunk > > > > chunks
 
std::vector< BlockVertexvertices
 
std::vector< uint32_t > indices
 
std::vector< BlockVertexwater_vertices
 
std::vector< uint32_t > water_indices
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
POS 
NEUT 
NEG 

◆ Dimensions

enum class CreateMeshData::Dimensions
strong
Enumerator

Constructor & Destructor Documentation

◆ CreateMeshData() [1/3]

CreateMeshData::CreateMeshData ( const glm::ivec3 &  pos,
const glm::ivec3 &  size,
ChunkMap chunk_map 
)

Create a Mesh Data object.

Parameters
posthe position of the chunk in the chunk map
sizethe number of chunks to create the mesh data
chunk_mapthe chunk map

◆ CreateMeshData() [2/3]

CreateMeshData::CreateMeshData ( const CreateMeshData )
delete

◆ CreateMeshData() [3/3]

CreateMeshData::CreateMeshData ( CreateMeshData &&  other)

◆ ~CreateMeshData()

CreateMeshData::~CreateMeshData ( )

Member Function Documentation

◆ create()

void CreateMeshData::create ( )

◆ createFace()

void CreateMeshData::createFace ( const int  dim_1,
const int  dim_2,
const glm::ivec3 &  start,
const glm::ivec3 &  max_iter,
const std::array< int, 6 > &  indices_order,
const std::array< int, 6 > &  indices_order_fliped,
const glm::ivec3 &  abs_normal,
const int  normal_signe,
const int  face 
)

◆ createFaceWater()

void CreateMeshData::createFaceWater ( const int  dim_1,
const int  dim_2,
const glm::ivec3 &  start,
const glm::ivec3 &  max_iter,
const std::array< int, 6 > &  indices_order,
const std::array< int, 6 > &  indices_order_fliped,
const glm::ivec3 &  abs_normal,
const int  normal_signe,
const int  face 
)

◆ getAmbientOcclusion() [1/2]

int CreateMeshData::getAmbientOcclusion ( BlockInfo::Type  side_1,
BlockInfo::Type  side_2,
BlockInfo::Type  corner 
)

◆ getAmbientOcclusion() [2/2]

std::array< uint8_t, 4 > CreateMeshData::getAmbientOcclusion ( const glm::ivec3 &  pos,
const int  dim_1,
const int  dim_2 
)

◆ getBlock() [1/2]

BlockInfo::Type CreateMeshData::getBlock ( const glm::ivec3 &  pos)

◆ getBlock() [2/2]

BlockInfo::Type CreateMeshData::getBlock ( const int  x,
const int  y,
const int  z 
)

◆ getCenterChunk()

std::shared_ptr< Chunk > CreateMeshData::getCenterChunk ( )
inline

◆ getLight() [1/4]

uint8_t CreateMeshData::getLight ( const glm::ivec3 &  pos)

◆ getLight() [2/4]

std::array< uint8_t, 4 > CreateMeshData::getLight ( const glm::ivec3 &  pos,
const int  dim_1,
const int  dim_2 
)

◆ getLight() [3/4]

uint8_t CreateMeshData::getLight ( const int  x,
const int  y,
const int  z 
)

◆ getLight() [4/4]

uint8_t CreateMeshData::getLight ( uint8_t  pos,
uint8_t  side_1,
uint8_t  side_2,
uint8_t  corner 
)

◆ operator=() [1/2]

CreateMeshData & CreateMeshData::operator= ( const CreateMeshData )
delete

◆ operator=() [2/2]

CreateMeshData & CreateMeshData::operator= ( CreateMeshData &&  other)

◆ unlock()

void CreateMeshData::unlock ( )

Member Data Documentation

◆ chunks

std::vector<std::vector<std::vector<std::shared_ptr<Chunk> > > > CreateMeshData::chunks

◆ indices

std::vector<uint32_t> CreateMeshData::indices

◆ vertices

std::vector<BlockVertex> CreateMeshData::vertices

◆ water_indices

std::vector<uint32_t> CreateMeshData::water_indices

◆ water_vertices

std::vector<BlockVertex> CreateMeshData::water_vertices

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