33 lines
750 B
C
33 lines
750 B
C
//
|
|
// Created by martin on 12.11.21.
|
|
//
|
|
|
|
#ifndef ANIMTESTBED_SPEEDSCALENODE_H
|
|
#define ANIMTESTBED_SPEEDSCALENODE_H
|
|
|
|
#include "AnimNode.h"
|
|
|
|
struct SpeedScaleNode : public AnimNode {
|
|
SpeedScaleNode(AnimationController* animation_controller): AnimNode (animation_controller), m_time_scale(1.f) {}
|
|
|
|
float m_time_scale;
|
|
AnimNode* m_child_node;
|
|
|
|
virtual void Reset() {
|
|
m_current_time = 0.f;
|
|
}
|
|
|
|
virtual void Update(float dt) {
|
|
m_current_time += dt * m_time_scale;
|
|
m_child_node->Update(dt * m_time_scale);
|
|
}
|
|
|
|
virtual void Evaluate(ozz::vector<ozz::math::SoaTransform>* local_matrices) override {
|
|
m_child_node->Evaluate(local_matrices);
|
|
};
|
|
|
|
virtual void DrawDebugUi() override;
|
|
};
|
|
|
|
#endif //ANIMTESTBED_SPEEDSCALENODE_H
|