Skip to content

Commit

Permalink
removed plateform generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Surer committed Jun 11, 2021
1 parent baf6e0b commit 3943877
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion OpenGL/OpenGL/src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int main(int argc, char* argv[]) {
text_posPlayer.setText(text.str());

text.str(""); // "clears" the string stream
text << "GameTime : " << std::fixed << std::setprecision(3) << t;
text << "Game Time : " << std::fixed << std::setprecision(3) << t;
text_gameTime.setText(text.str());
}

Expand Down
2 changes: 1 addition & 1 deletion OpenGL/OpenGL/src/terrain/Generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ std::vector<Structure::Slice> Generator::generateStructures(ivec3 cpos, Chunk& c
if (chunk[dpos]->type == BlockType::Snow && biome.type == BiomeType::TOUNDRA) {
ivec3 pos = orig + dpos;
float editPlateforme = valueNoise.sample1D(ivec2(pos.x, pos.z)) / (float)UINT32_MAX;
if (editPlateforme < 0.0001f) {
if (editPlateforme < 0.0000f) {
auto editPlateformeSlice = defaultEditPlaterforme.spawn(chunk, dpos);
slices.insert(slices.end(), editPlateformeSlice.begin(), editPlateformeSlice.end());
}
Expand Down
2 changes: 1 addition & 1 deletion OpenGL/OpenGL/src/terrain/Generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Generator {
Oak_Tree defaultOakTree;
Birch_Tree defaultBirchTree;
Cactus defaultCactus;
EditPlaterforme defaultEditPlaterforme;
EditPlateforme defaultEditPlaterforme;
public:
BiomeMap biomeSampler;
};
8 changes: 4 additions & 4 deletions OpenGL/OpenGL/src/terrain/Structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ std::vector<Birch_Tree::Slice> Birch_Tree::spawn(Chunk& chunk, ivec3 pos) const
}


EditPlaterforme::EditPlaterforme()
EditPlateforme::EditPlateforme()
: store(std::make_shared<BlockStore>(ivec3(33, 2, 33)))
{
ivec3 pos = ivec3(0,0,0);
Expand All @@ -193,14 +193,14 @@ EditPlaterforme::EditPlaterforme()
}


std::vector<EditPlaterforme::Slice> EditPlaterforme::spawn(Chunk& chunk, ivec3 pos) const {
std::vector<EditPlaterforme::Slice> slices;
std::vector<EditPlateforme::Slice> EditPlateforme::spawn(Chunk& chunk, ivec3 pos) const {
std::vector<EditPlateforme::Slice> slices;
ivec3 origin(0, -1, 0); // the tree is generated centered on the trunk, one block above
ivec3 start = pos - origin;

auto genSlice = [&](ivec3 chunkOffset) {
ivec3 sliceStart = start - chunk.size * chunkOffset; // position of the structure's min corner in this chunk space
slices.emplace_back(EditPlaterforme::Slice{
slices.emplace_back(EditPlateforme::Slice{
store,
chunk.chunkPos + chunkOffset,
max(sliceStart, ivec3(0)) - sliceStart,
Expand Down
4 changes: 2 additions & 2 deletions OpenGL/OpenGL/src/terrain/Structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class Cactus : public Structure {
std::shared_ptr<BlockStore> store;
};

class EditPlaterforme : public Structure {
class EditPlateforme : public Structure {

public:
EditPlaterforme();
EditPlateforme();
slices_t spawn(Chunk& chunk, glm::ivec3 pos) const override;
std::shared_ptr<BlockStore> store;
};

0 comments on commit 3943877

Please sign in to comment.