diff options
author | x2048 <codeforsmile@gmail.com> | 2022-07-17 15:45:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-17 14:45:42 +0100 |
commit | 7b6c4bf2e017d35e51c28736e31d03b5341edf27 (patch) | |
tree | 19c66ca0cbda39d2728bbae81d16412c1cffc1fe | |
parent | f090471022513401257e132334d03ee6c10aafa7 (diff) | |
download | minetest-7b6c4bf2e017d35e51c28736e31d03b5341edf27.tar.gz minetest-7b6c4bf2e017d35e51c28736e31d03b5341edf27.tar.bz2 minetest-7b6c4bf2e017d35e51c28736e31d03b5341edf27.zip |
Remove workaround for normals not matching winding order (#12460)
Co-authored-by: sfan5 <sfan5@live.de>
-rw-r--r-- | src/client/mesh.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/client/mesh.cpp b/src/client/mesh.cpp index 8a6f9b37a..4bf07effa 100644 --- a/src/client/mesh.cpp +++ b/src/client/mesh.cpp @@ -330,9 +330,6 @@ void recalculateBoundingBox(scene::IMesh *src_mesh) bool checkMeshNormals(scene::IMesh *mesh) { - // Assume correct normals if this many first faces get it right. - static const u16 MAX_FACES_TO_CHECK = 9; - u32 buffer_count = mesh->getMeshBufferCount(); for (u32 i = 0; i < buffer_count; i++) { @@ -346,19 +343,6 @@ bool checkMeshNormals(scene::IMesh *mesh) if (!std::isfinite(length) || length < 1e-10f) return false; - - const u16 count = MYMIN(MAX_FACES_TO_CHECK * 3, buffer->getIndexCount() - 3); - for (u16 i = 0; i < count; i += 3) { - - core::plane3df plane(buffer->getPosition(buffer->getIndices()[i]), - buffer->getPosition(buffer->getIndices()[i+1]), - buffer->getPosition(buffer->getIndices()[i+2])); - - for (u16 j = 0; j < 3; j++) - if (plane.Normal.dotProduct(buffer->getNormal(buffer->getIndices()[i+j])) <= 0) - return false; - } - } return true; |