mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-30 23:30:27 +02:00
Fix updating of vertex normals for animated meshes (#77)
Updates cached positions and normals of animated vertices from the mesh. Useful when using meshManipulator to update the normals.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "CMeshManipulator.h"
|
||||
#include "ISkinnedMesh.h"
|
||||
#include "SMesh.h"
|
||||
#include "CMeshBuffer.h"
|
||||
#include "SAnimatedMesh.h"
|
||||
@ -149,6 +150,12 @@ void CMeshManipulator::recalculateNormals(scene::IMesh* mesh, bool smooth, bool
|
||||
const u32 bcount = mesh->getMeshBufferCount();
|
||||
for ( u32 b=0; b<bcount; ++b)
|
||||
recalculateNormals(mesh->getMeshBuffer(b), smooth, angleWeighted);
|
||||
|
||||
if (mesh->getMeshType() == EAMT_SKINNED)
|
||||
{
|
||||
ISkinnedMesh *smesh = (ISkinnedMesh *) mesh;
|
||||
smesh->refreshJointCache();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user