// // Created by martin on 12.11.21. // #ifndef ANIMTESTBED_ANIMATIONCONTROLLER_H #define ANIMTESTBED_ANIMATIONCONTROLLER_H #include #include #include #include #include struct SkinnedMesh; struct AnimNode; struct AnimationController { explicit AnimationController(SkinnedMesh* skinned_mesh); virtual ~AnimationController(); void ResetAnims(); // Creates a list of nodes where for node at index i for all inputs holds index > i. void UpdateOrderedNodes(); // Updates all nodes. void Update(float dt); // Recursively evaluates all nodes. void Evaluate(); void DrawDebugUi(); float m_current_time; ozz::vector m_local_matrices; ozz::vector m_local_matrices_blended; ozz::animation::SamplingCache m_sampling_cache_A; SkinnedMesh* m_skinned_mesh = nullptr; AnimNode* m_output_node; std::vector m_anim_nodes; std::vector m_ordered_nodes; }; #endif //ANIMTESTBED_ANIMATIONCONTROLLER_H