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

Method Job

Source/Engine/Animations/Animations.cpp:85–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void AnimationsSystem::Job(int32 index)
86{
87 PROFILE_CPU_NAMED("Animations.Job");
88 PROFILE_MEM(Animations);
89 auto animatedModel = AnimationManagerInstance.UpdateList[index];
90 if (CanUpdateModel(animatedModel))
91 {
92 auto graph = animatedModel->AnimationGraph.Get();
93#if COMPILE_WITH_PROFILER && TRACY_ENABLE
94 const StringView graphName(graph->GetPath());
95 ZoneName(*graphName, graphName.Length());
96#endif
97
98 // Prepare skinning data
99 animatedModel->SetupSkinningData();
100
101 // Animation delta time can be based on a time since last update or the current delta
102 float dt = animatedModel->UseTimeScale ? DeltaTime : UnscaledDeltaTime;
103 float t = animatedModel->UseTimeScale ? Time : UnscaledTime;
104 const float lastUpdateTime = animatedModel->GraphInstance.LastUpdateTime;
105 if (lastUpdateTime > 0 && t > lastUpdateTime)
106 {
107 dt = t - lastUpdateTime;
108 }
109 dt *= animatedModel->UpdateSpeed;
110 animatedModel->GraphInstance.LastUpdateTime = t;
111
112 // Evaluate animated nodes pose
113 graph->GraphExecutor.Update(animatedModel->GraphInstance, dt);
114
115 // Update gameplay
116 animatedModel->OnAnimationUpdated_Async();
117 }
118}
119
120void AnimationsSystem::Execute(TaskGraph* graph)
121{

Callers

nothing calls this directly

Calls 7

CanUpdateModelFunction · 0.85
SetupSkinningDataMethod · 0.80
GetMethod · 0.45
GetPathMethod · 0.45
LengthMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected