summaryrefslogtreecommitdiff
path: root/src/client/content_cao.cpp
diff options
context:
space:
mode:
authorDanila Shutov <dcbrwn2@gmail.com>2020-06-07 19:14:00 +0300
committerGitHub <noreply@github.com>2020-06-07 18:14:00 +0200
commitfe1f72ab0ac8bcc233c91eb5b2d71bd2d2574cf8 (patch)
tree4be77389e38c97dd1391439f212db642b16fac0b /src/client/content_cao.cpp
parent8fc9e7eb117849202b87bf3d764cd3eac6f68c74 (diff)
downloadminetest-fe1f72ab0ac8bcc233c91eb5b2d71bd2d2574cf8.tar.gz
minetest-fe1f72ab0ac8bcc233c91eb5b2d71bd2d2574cf8.tar.bz2
minetest-fe1f72ab0ac8bcc233c91eb5b2d71bd2d2574cf8.zip
Recalculate mesh normals for CAOs (#10000)
Diffstat (limited to 'src/client/content_cao.cpp')
-rw-r--r--src/client/content_cao.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp
index 855729642..a6ce06d20 100644
--- a/src/client/content_cao.cpp
+++ b/src/client/content_cao.cpp
@@ -726,6 +726,14 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
addAnimatedMeshSceneNode(mesh, m_matrixnode);
m_animated_meshnode->grab();
mesh->drop(); // The scene node took hold of it
+
+ if (!checkMeshNormals(mesh)) {
+ infostream << "GenericCAO: recalculating normals for mesh "
+ << m_prop.mesh << std::endl;
+ m_smgr->getMeshManipulator()->
+ recalculateNormals(mesh, true, false);
+ }
+
m_animated_meshnode->animateJoints(); // Needed for some animations
m_animated_meshnode->setScale(m_prop.visual_size);