mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-01 15:50: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:
@ -813,6 +813,21 @@ bool CSkinnedMesh::setHardwareSkinning(bool on)
|
||||
return HardwareSkinning;
|
||||
}
|
||||
|
||||
void CSkinnedMesh::refreshJointCache()
|
||||
{
|
||||
//copy cache from the mesh...
|
||||
for (u32 i=0; i<AllJoints.size(); ++i)
|
||||
{
|
||||
SJoint *joint=AllJoints[i];
|
||||
for (u32 j=0; j<joint->Weights.size(); ++j)
|
||||
{
|
||||
const u16 buffer_id=joint->Weights[j].buffer_id;
|
||||
const u32 vertex_id=joint->Weights[j].vertex_id;
|
||||
joint->Weights[j].StaticPos = LocalBuffers[buffer_id]->getVertex(vertex_id)->Pos;
|
||||
joint->Weights[j].StaticNormal = LocalBuffers[buffer_id]->getVertex(vertex_id)->Normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSkinnedMesh::calculateGlobalMatrices(SJoint *joint,SJoint *parentJoint)
|
||||
{
|
||||
|
Reference in New Issue
Block a user