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

Method SetNodeTransformation

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

Source from the content-addressed store, hash-verified

263}
264
265void AnimatedModel::SetNodeTransformation(int32 nodeIndex, const Matrix& nodeTransformation, bool worldSpace)
266{
267 if (GraphInstance.NodesPose.IsEmpty())
268 const_cast<AnimatedModel*>(this)->PreInitSkinningData(); // Ensure to have valid nodes pose to return
269 CHECK(nodeIndex >= 0 && nodeIndex < GraphInstance.NodesPose.Count());
270 GraphInstance.NodesPose[nodeIndex] = nodeTransformation;
271 if (worldSpace)
272 {
273 Matrix world;
274 GetLocalToWorldMatrix(world);
275 Matrix invWorld;
276 Matrix::Invert(world, invWorld);
277 GraphInstance.NodesPose[nodeIndex] = GraphInstance.NodesPose[nodeIndex] * invWorld;
278 }
279 OnAnimationUpdated();
280}
281
282void AnimatedModel::SetNodeTransformation(const Array<NodeTransformation>& nodeTransformations, bool worldSpace)
283{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected