Commit 8292b7fe authored by hybrid's avatar hybrid

Fix bounding boxes for skinned meshes. Moved LocalMatrix computation out of...

Fix bounding boxes for skinned meshes. Moved LocalMatrix computation out of the loop. This works for the meshes I tested, but might break with others. Further testing required.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2768 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d9e92b07
...@@ -62,7 +62,6 @@ IMesh* CSkinnedMesh::getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 ...@@ -62,7 +62,6 @@ IMesh* CSkinnedMesh::getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop, s32
return this; return this;
animateMesh((f32)frame, 1.0f); animateMesh((f32)frame, 1.0f);
buildAll_LocalAnimatedMatrices();
skinMesh(); skinMesh();
return this; return this;
} }
...@@ -117,6 +116,7 @@ void CSkinnedMesh::animateMesh(f32 frame, f32 blend) ...@@ -117,6 +116,7 @@ void CSkinnedMesh::animateMesh(f32 frame, f32 blend)
joint->Animatedscale = core::lerp(oldScale, scale, blend); joint->Animatedscale = core::lerp(oldScale, scale, blend);
joint->Animatedrotation.slerp(oldRotation, rotation, blend); joint->Animatedrotation.slerp(oldRotation, rotation, blend);
} }
}
//Note: //Note:
//_LocalAnimatedMatrix needs to be built at some point, but this function may be called lots of times for //_LocalAnimatedMatrix needs to be built at some point, but this function may be called lots of times for
...@@ -127,7 +127,6 @@ void CSkinnedMesh::animateMesh(f32 frame, f32 blend) ...@@ -127,7 +127,6 @@ void CSkinnedMesh::animateMesh(f32 frame, f32 blend)
// Temp! // Temp!
buildAll_LocalAnimatedMatrices(); buildAll_LocalAnimatedMatrices();
//----------------- //-----------------
}
updateBoundingBox(); updateBoundingBox();
} }
...@@ -462,6 +461,7 @@ void CSkinnedMesh::skinMesh() ...@@ -462,6 +461,7 @@ void CSkinnedMesh::skinMesh()
for (i=0; i<SkinningBuffers->size(); ++i) for (i=0; i<SkinningBuffers->size(); ++i)
(*SkinningBuffers)[i]->setDirty(EBT_VERTEX); (*SkinningBuffers)[i]->setDirty(EBT_VERTEX);
} }
updateBoundingBox();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment