Added a class with the purpose of creating the chunks base terrain.
This commit is contained in:
parent
0b62550f54
commit
566b6ca064
2 changed files with 36 additions and 0 deletions
18
src/ChunkMCMeshBuilder.cpp
Normal file
18
src/ChunkMCMeshBuilder.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include "ChunkMCMeshBuilder.h"
|
||||
|
||||
ChunkMCMeshBuilder::ChunkMCMeshBuilder() : chunkTerrain(nullptr) {
|
||||
// Data to create the Mesh
|
||||
std::vector<Vertex> vertices;
|
||||
std::vector<unsigned int> indices;
|
||||
std::vector<Texture> textures;
|
||||
|
||||
// TODO: Build/load Mesh data here, it's better practice to place this in a
|
||||
// function but fuck it.
|
||||
|
||||
// Create the Mesh
|
||||
this->chunkTerrain = new Mesh(vertices, indices, textures);
|
||||
}
|
||||
|
||||
ChunkMCMeshBuilder::~ChunkMCMeshBuilder() { delete this->chunkTerrain; }
|
||||
|
||||
Mesh *ChunkMCMeshBuilder::getChunkMesh() { return chunkTerrain; }
|
||||
18
src/ChunkMCMeshBuilder.h
Normal file
18
src/ChunkMCMeshBuilder.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
#include "Error.h"
|
||||
#include "Mesh.h"
|
||||
|
||||
// MC stands for Marching Cubes
|
||||
class ChunkMCMeshBuilder {
|
||||
|
||||
private:
|
||||
Error error = Error("ChunkMCMeshBuilder");
|
||||
|
||||
Mesh *chunkTerrain;
|
||||
|
||||
public:
|
||||
ChunkMCMeshBuilder();
|
||||
~ChunkMCMeshBuilder();
|
||||
|
||||
Mesh *getChunkMesh();
|
||||
};
|
||||
Loading…
Reference in a new issue