MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetCurrentPose

Method SetCurrentPose

Source/Engine/Level/Actors/AnimatedModel.cpp:218–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void AnimatedModel::SetCurrentPose(const Array<Matrix>& nodesTransformation, bool worldSpace)
219{
220 if (GraphInstance.NodesPose.IsEmpty())
221 const_cast<AnimatedModel*>(this)->PreInitSkinningData(); // Ensure to have valid nodes pose to return
222 CHECK(nodesTransformation.Count() == GraphInstance.NodesPose.Count());
223 GraphInstance.NodesPose = nodesTransformation;
224 if (worldSpace)
225 {
226 Matrix world;
227 GetLocalToWorldMatrix(world);
228 Matrix invWorld;
229 Matrix::Invert(world, invWorld);
230 for (auto& m : GraphInstance.NodesPose)
231 m = m * invWorld;
232 }
233 OnAnimationUpdated();
234}
235
236void AnimatedModel::GetNodeTransformation(int32 nodeIndex, Matrix& nodeTransformation, bool worldSpace) const
237{

Callers 1

OnFixedUpdateMethod · 0.80

Calls 4

PreInitSkinningDataMethod · 0.80
InvertFunction · 0.50
IsEmptyMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected