Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
AnimationAsset.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <glm/glm.hpp>
5#include <glm/gtc/quaternion.hpp>
6#include <string>
7#include <vector>
8
10{
11
21
38} // namespace Engine::Animation
39
41{
50 {
51 public:
52 Animation() = default;
53
54 [[nodiscard]] float getDuration() const
55 {
56 return duration_;
57 }
58
59 [[nodiscard]] const std::string & getName() const
60 {
61 return name_;
62 }
63
64 [[nodiscard]] const std::vector<Engine::Animation::AnimationChannel> & getChannels() const
65 {
66 return channels_;
67 }
68
81 void sample(
82 uint32_t channelIndex,
83 float time,
84 glm::vec3 & outTranslation,
85 glm::quat & outRotation,
86 glm::vec3 & outScale
87 ) const;
88
89 // TODO: check if these variables need to be public
90 std::string name_;
91 float duration_ = 0.0f;
92
93 std::vector<Engine::Animation::AnimationChannel> channels_;
94 };
95} // namespace Engine::Assets
const std::string & getName() const
void sample(uint32_t channelIndex, float time, glm::vec3 &outTranslation, glm::quat &outRotation, glm::vec3 &outScale) const
Sample a specific channel at the given time.
std::vector< Engine::Animation::AnimationChannel > channels_
const std::vector< Engine::Animation::AnimationChannel > & getChannels() const
InterpolationType
Interpolation method for animation keyframes.
A single animation channel targeting one joint's transform property.
enum Engine::Animation::AnimationChannel::Path path
std::vector< glm::vec4 > values
vec3 for T/S (w unused), quat for R (xyzw)