mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
Merge branch 'MihailRis:main' into main
This commit is contained in:
commit
533a27c04b
3 changed files with 5 additions and 3 deletions
|
|
@ -145,6 +145,9 @@ private:
|
|||
|
||||
// Does block allow to see other blocks sides (is it transparent)
|
||||
bool isOpen(const glm::ivec3& pos, const Block& def, const Variant& variant) const {
|
||||
if (pos.y >= CHUNK_H) {
|
||||
return true;
|
||||
}
|
||||
const auto& vox = voxelsBuffer->pickBlock(
|
||||
chunk->x * CHUNK_W + pos.x, pos.y, chunk->z * CHUNK_D + pos.z
|
||||
);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static std::unique_ptr<xml::xmlelement> toxml(lua::State* L) {
|
|||
break;
|
||||
}
|
||||
auto key = lua::require_lstring(L, -1);
|
||||
if (key == "@") {
|
||||
if (key == TAG_ATTR) {
|
||||
break;
|
||||
}
|
||||
auto value = lua::require_lstring(L, -2);
|
||||
|
|
|
|||
|
|
@ -128,11 +128,10 @@ static int l_noise(lua::State* L) {
|
|||
}
|
||||
|
||||
float noiseValue = fnlGetNoise2D(noise, u, v);
|
||||
float t = 1.0f / static_cast<float>(1 << c) * multiplier;
|
||||
if (normalizedNoise) {
|
||||
float t = 1.0f / (static_cast<float>(1 << c) * multiplier);
|
||||
value = value * (1.0f - t) + noiseValue * t;
|
||||
} else {
|
||||
float t = 1.0f / static_cast<float>(1 << c) * multiplier;
|
||||
value += noiseValue * t;
|
||||
}
|
||||
heights[i] = value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue