2
0
Эх сурвалжийг харах

Fix broken normals: restore lines removed in commit cb22d53 of 4 May 2023 (#5824)

Co-authored-by: Steve M <[email protected]>
Steve M 11 сар өмнө
parent
commit
2591d0e490

+ 2 - 0
code/AssetLib/LWO/LWOLoader.cpp

@@ -527,6 +527,7 @@ void LWOImporter::ComputeNormals(aiMesh *mesh, const std::vector<unsigned int> &
                         continue;
                     vNormals += v;
                 }
+                mesh->mNormals[idx] = vNormals.Normalize();
             }
         }
     }
@@ -547,6 +548,7 @@ void LWOImporter::ComputeNormals(aiMesh *mesh, const std::vector<unsigned int> &
                     const aiVector3D &v = faceNormals[*a];
                     vNormals += v;
                 }
+                vNormals.Normalize();
                 for (std::vector<unsigned int>::const_iterator a = poResult.begin(); a != poResult.end(); ++a) {
                     mesh->mNormals[*a] = vNormals;
                     vertexDone[*a] = true;