AnimTestbed/src/AnimationController.h

49 lines
1.1 KiB
C
Raw Normal View History

2021-11-12 20:10:56 +01:00
//
// Created by martin on 12.11.21.
//
#ifndef ANIMTESTBED_ANIMATIONCONTROLLER_H
#define ANIMTESTBED_ANIMATIONCONTROLLER_H
2021-11-12 21:16:43 +01:00
#include <ozz/animation/runtime/animation.h>
2021-11-12 20:10:56 +01:00
#include <ozz/animation/runtime/sampling_job.h>
2021-11-12 21:16:43 +01:00
#include <ozz/base/containers/vector.h>
#include <ozz/base/maths/soa_transform.h>
#include <ozz/base/maths/transform.h>
2021-11-12 21:16:43 +01:00
#include <ozz/base/maths/vec_float.h>
2021-11-12 20:10:56 +01:00
struct SkinnedMesh;
2021-11-12 21:16:43 +01:00
struct AnimNode;
2021-11-12 20:10:56 +01:00
struct AnimationController {
explicit AnimationController(SkinnedMesh* skinned_mesh);
2021-11-12 21:16:43 +01:00
virtual ~AnimationController();
2021-11-12 20:10:56 +01:00
2021-11-13 00:08:32 +01:00
void ResetAnims();
2021-11-13 12:35:23 +01:00
// 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);
2021-11-13 12:35:23 +01:00
// Recursively evaluates all nodes.
2021-11-12 20:10:56 +01:00
void Evaluate();
void DrawDebugUi();
float m_current_time;
bool m_paused;
bool m_calc_root_transform;
ozz::math::Transform m_root_transform;
2021-11-12 20:10:56 +01:00
SkinnedMesh* m_skinned_mesh = nullptr;
2021-11-12 21:16:43 +01:00
AnimNode* m_output_node;
std::vector<AnimNode*> m_anim_nodes;
std::vector<AnimNode*> m_ordered_nodes;
2021-11-12 20:10:56 +01:00
};
#endif //ANIMTESTBED_ANIMATIONCONTROLLER_H