From fe1f72ab0ac8bcc233c91eb5b2d71bd2d2574cf8 Mon Sep 17 00:00:00 2001 From: Danila Shutov Date: Sun, 7 Jun 2020 19:14:00 +0300 Subject: Recalculate mesh normals for CAOs (#10000) --- src/client/content_cao.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/client/content_cao.cpp') 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); -- cgit v1.2.3