Reset mesh animation state before recalculating normals (#90)

This commit is contained in:
x2048
2022-01-02 20:41:03 +01:00
committed by GitHub
parent 52e03a8485
commit 2fec5e5dd3
4 changed files with 30 additions and 0 deletions

View File

@ -147,6 +147,12 @@ void CMeshManipulator::recalculateNormals(scene::IMesh* mesh, bool smooth, bool
if (!mesh)
return;
if (mesh->getMeshType() == EAMT_SKINNED)
{
ISkinnedMesh *smesh = (ISkinnedMesh *) mesh;
smesh->resetAnimation();
}
const u32 bcount = mesh->getMeshBufferCount();
for ( u32 b=0; b<bcount; ++b)
recalculateNormals(mesh->getMeshBuffer(b), smooth, angleWeighted);