Recalculate normals for mesh #0. Fix for issue #1902.
authorRealBadAngel <maciej.kasatkin@o2.pl>
Fri, 5 Dec 2014 00:04:25 +0000 (01:04 +0100)
committerRealBadAngel <maciej.kasatkin@o2.pl>
Fri, 5 Dec 2014 00:05:18 +0000 (01:05 +0100)
src/nodedef.cpp

index deb08fda9e11a3950c2eff733d110b905e9fdff8..99557472e22234c44c81e7a93f7e37867b6777c4 100644 (file)
@@ -854,6 +854,7 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef)
                                v3f scale = v3f(1.0, 1.0, 1.0) * BS * f->visual_scale;
                                scaleMesh(f->mesh_ptr[0], scale);
                                recalculateBoundingBox(f->mesh_ptr[0]);
+                               meshmanip->recalculateNormals(f->mesh_ptr[0], true, false);
                        }
                } else if ((f->drawtype == NDT_NODEBOX) && 
                                ((f->node_box.type == NODEBOX_REGULAR) ||
@@ -866,6 +867,7 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef)
                        v3f scale = v3f(1.0, 1.0, 1.0) * f->visual_scale;
                        scaleMesh(f->mesh_ptr[0], scale);
                        recalculateBoundingBox(f->mesh_ptr[0]);
+                       meshmanip->recalculateNormals(f->mesh_ptr[0], true, false);
                }
 
                //Cache 6dfacedir and wallmounted rotated clones of meshes