Skip to content

Commit e030d9c

Browse files
authoredJan 2, 2022
Recalculate normals before adding mesh to the scene
1 parent 8910c7f commit e030d9c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

Diff for: ‎src/client/content_cao.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -764,17 +764,16 @@ void GenericCAO::addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr)
764764
grabMatrixNode();
765765
scene::IAnimatedMesh *mesh = m_client->getMesh(m_prop.mesh, true);
766766
if (mesh) {
767-
m_animated_meshnode = m_smgr->addAnimatedMeshSceneNode(mesh, m_matrixnode);
768-
m_animated_meshnode->grab();
769-
mesh->drop(); // The scene node took hold of it
770-
771767
if (!checkMeshNormals(mesh)) {
772768
infostream << "GenericCAO: recalculating normals for mesh "
773769
<< m_prop.mesh << std::endl;
774770
m_smgr->getMeshManipulator()->
775771
recalculateNormals(mesh, true, false);
776772
}
777773

774+
m_animated_meshnode = m_smgr->addAnimatedMeshSceneNode(mesh, m_matrixnode);
775+
m_animated_meshnode->grab();
776+
mesh->drop(); // The scene node took hold of it
778777
m_animated_meshnode->animateJoints(); // Needed for some animations
779778
m_animated_meshnode->setScale(m_prop.visual_size);
780779

0 commit comments

Comments
 (0)
Please sign in to comment.