Optimize memory allocation when reading animated model pose by cloth

This commit is contained in:
Wojtek Figat
2025-06-06 22:41:48 +02:00
parent d95cd2f0be
commit 462f75abd0
3 changed files with 15 additions and 4 deletions

View File

@@ -140,6 +140,13 @@ void AnimatedModel::GetCurrentPose(Array<Matrix>& nodesTransformation, bool worl
}
}
void AnimatedModel::GetCurrentPose(Span<Matrix>& nodesTransformation) const
{
if (GraphInstance.NodesPose.IsEmpty())
const_cast<AnimatedModel*>(this)->PreInitSkinningData(); // Ensure to have valid nodes pose to return
nodesTransformation = ToSpan(GraphInstance.NodesPose);
}
void AnimatedModel::SetCurrentPose(const Array<Matrix>& nodesTransformation, bool worldSpace)
{
if (GraphInstance.NodesPose.IsEmpty())