Optimize memory allocation when reading animated model pose by cloth
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -213,6 +213,12 @@ public:
|
||||
/// <param name="worldSpace">True if convert matrices into world-space, otherwise returned values will be in local-space of the actor.</param>
|
||||
API_FUNCTION() void GetCurrentPose(API_PARAM(Out) Array<Matrix>& nodesTransformation, bool worldSpace = false) const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the per-node final transformations (skeleton pose).
|
||||
/// </summary>
|
||||
/// <param name="nodesTransformation">The output per-node final transformation matrices.</param>
|
||||
void GetCurrentPose(Span<Matrix>& nodesTransformation) const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the per-node final transformations (skeleton pose).
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user