3#include "system/Codable.hpp"
23 virtual glm::mat4
apply(
const glm::mat4 & m,
double fullTime,
double frameTime) = 0;
31 virtual glm::vec4
apply(
const glm::vec4 & v,
double fullTime,
double frameTime) = 0;
61 static std::vector<std::shared_ptr<Animation>>
decode(
const std::vector<KeyValues> & params);
67 static std::vector<KeyValues>
encode(
const std::vector<std::shared_ptr<Animation>> & anims);
115 glm::mat4
apply(
const glm::mat4 & m,
double fullTime,
double frameTime)
override;
123 glm::vec4
apply(
const glm::vec4 & v,
double fullTime,
double frameTime)
override;
142 glm::vec3
_axis = glm::vec3(1.0f, 0.0f, 0.0f);
167 glm::mat4
apply(
const glm::mat4 & m,
double fullTime,
double frameTime)
override;
175 glm::vec4
apply(
const glm::vec4 & v,
double fullTime,
double frameTime)
override;
194 glm::vec3
_axis = glm::vec3(1.0f, 0.0f, 0.0f);
An animation is a transformation evaluated at each frame and applied to an object.
Definition: Animation.hpp:9
bool decodeBase(const KeyValues ¶ms)
Definition: Animation.cpp:41
Animation & operator=(const Animation &)=delete
Animation & operator=(Animation &&)=delete
static std::vector< std::shared_ptr< Animation > > decode(const std::vector< KeyValues > ¶ms)
Definition: Animation.cpp:7
Animation(Animation &&)=delete
virtual glm::vec4 apply(const glm::vec4 &v, double fullTime, double frameTime)=0
virtual KeyValues encode() const
Definition: Animation.cpp:51
virtual glm::mat4 apply(const glm::mat4 &m, double fullTime, double frameTime)=0
virtual ~Animation()=default
Animation(const Animation &)=delete
Frame
Frame in which the transformation shoud be applied.
Definition: Animation.hpp:12
@ WORLD
World space (left multiplication)
@ MODEL
Model space (right multiplication)
Frame _frame
The frame of transformation.
Definition: Animation.hpp:90
float _speed
Speed of the animation.
Definition: Animation.hpp:91
Translate an object back and forth along a direction.
Definition: Animation.hpp:148
glm::mat4 apply(const glm::mat4 &m, double fullTime, double frameTime) override
Definition: Animation.cpp:97
KeyValues encode() const override
Definition: Animation.cpp:131
double _previousAbscisse
Position on the path at the previous frame.
Definition: Animation.hpp:196
bool decode(const KeyValues ¶ms)
Definition: Animation.cpp:116
float _amplitude
Amplitude of the translation (maximum distance).
Definition: Animation.hpp:195
glm::vec3 _axis
Translation direction.
Definition: Animation.hpp:194
Rotate an object around an axis.
Definition: Animation.hpp:97
bool decode(const KeyValues ¶ms)
Definition: Animation.cpp:73
glm::vec3 _axis
Rotation axis.
Definition: Animation.hpp:142
glm::mat4 apply(const glm::mat4 &m, double fullTime, double frameTime) override
Definition: Animation.cpp:63
KeyValues encode() const override
Definition: Animation.cpp:84
Represent a key-values tuple.
Definition: Config.hpp:9