Files
OpenVulkano/openVulkanoCpp/Scene/SimpleAnimationController.hpp
2024-06-05 21:51:04 +03:00

32 lines
939 B
C++

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "Base/ITickable.hpp"
#include "Base/Event.hpp"
#include "Math/Math.hpp"
#include "Math/Pose.hpp"
#include "Scene/Node.hpp"
namespace OpenVulkano::Scene
{
class SimpleAnimationController : public ITickable
{
OpenVulkano::Scene::Node *m_node = nullptr;
OpenVulkano::Event<> m_event;
OpenVulkano::Math::Pose<float> m_targetPose;
OpenVulkano::Math::Pose<float> m_initialPose;
float m_duration = 0;
float m_elapsed = 0;
public:
SimpleAnimationController() = default;
SimpleAnimationController(OpenVulkano::Scene::Node *node, OpenVulkano::Math::Pose<float> initialPose, OpenVulkano::Math::Pose<float> targetPose, float duration);
void OnAnimationCompleted();
void Tick() override;
};
}