// // Created by martin on 12.11.21. // #ifndef ANIMTESTBED_ANIMATIONCONTROLLER_H #define ANIMTESTBED_ANIMATIONCONTROLLER_H #include #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 UpdateTime(float dt); // Recursively evaluates all nodes. void Evaluate(); void DrawDebugUi(); float m_current_time; bool m_paused; bool m_calc_root_transform; ozz::math::Transform m_root_transform; SkinnedMesh* m_skinned_mesh = nullptr; AnimNode* m_output_node; std::vector m_anim_nodes; std::vector m_ordered_nodes; }; #endif //ANIMTESTBED_ANIMATIONCONTROLLER_H