feat: add cave (#8)

* feat: add cave generate

* fix: incorrect blocks on cave surface

* fix: non-deterministic cave generator

* refactor: move all chunk generation to dedicated generation thread

* refactor: remove inital cave

* feat: add cave parameter adjustment

* refactor: adjust cave probability
This commit is contained in:
zhenyan121
2026-05-09 20:13:55 +08:00
committed by GitHub
parent d986e03f9c
commit 1a26474a05
19 changed files with 456 additions and 33 deletions

View File

@@ -1,10 +1,11 @@
#include "Cubed/tools/math_tools.hpp"
#include <algorithm>
#include <glm/gtc/type_ptr.hpp>
namespace Cubed {
namespace Math {
void extract_frustum_planes(const glm::mat4& mvp_matrix,
std::vector<glm::vec4>& planes) {
if (planes.size() != 6) {
@@ -37,6 +38,13 @@ void extract_frustum_planes(const glm::mat4& mvp_matrix,
}
}
float smootherstep(float edge0, float edge1, float x) {
x = std::clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f);
return x * x * x * (x * (6.0f * x - 15.0f) + 10.0f);
}
} // namespace Math
} // namespace Cubed