|
Rendu
A lightweight rendering engine for experimentations
|
Translate an object back and forth along a direction. More...
#include <Animation.hpp>
Public Member Functions | |
| BackAndForth ()=default | |
| BackAndForth (const glm::vec3 &axis, float speed, float amplitude, Frame frame) | |
| glm::mat4 | apply (const glm::mat4 &m, double fullTime, double frameTime) override |
| glm::vec4 | apply (const glm::vec4 &v, double fullTime, double frameTime) override |
| bool | decode (const KeyValues ¶ms) |
| KeyValues | encode () const override |
Public Member Functions inherited from Animation | |
| virtual glm::mat4 | apply (const glm::mat4 &m, double fullTime, double frameTime)=0 |
| virtual glm::vec4 | apply (const glm::vec4 &v, double fullTime, double frameTime)=0 |
| virtual KeyValues | encode () const |
| virtual | ~Animation ()=default |
| Animation (const Animation &)=delete | |
| Animation & | operator= (const Animation &)=delete |
| Animation (Animation &&)=delete | |
| Animation & | operator= (Animation &&)=delete |
Additional Inherited Members | |
Public Types inherited from Animation | |
| enum class | Frame { MODEL , WORLD } |
| Frame in which the transformation shoud be applied. More... | |
Static Public Member Functions inherited from Animation | |
| static std::vector< std::shared_ptr< Animation > > | decode (const std::vector< KeyValues > ¶ms) |
| static std::vector< KeyValues > | encode (const std::vector< std::shared_ptr< Animation > > &anims) |
Protected Member Functions inherited from Animation | |
| Animation ()=default | |
| Animation (Frame frame, float speed) | |
| bool | decodeBase (const KeyValues ¶ms) |
Protected Attributes inherited from Animation | |
| Frame | _frame = Frame::WORLD |
| The frame of transformation. | |
| float | _speed = 0.0f |
| Speed of the animation. | |
Translate an object back and forth along a direction.
Inherits Animation.
|
default |
Default constructor.
| BackAndForth::BackAndForth | ( | const glm::vec3 & | axis, |
| float | speed, | ||
| float | amplitude, | ||
| Frame | frame | ||
| ) |
Setup a back and forth animation.
| axis | the translation direction |
| speed | the animation speed |
| amplitude | the amplitude of the movement |
| frame | the animation frame |
|
overridevirtual |
Apply the animation transformation to the input matrix.
| m | the matrix to transform |
| fullTime | the time elapsed since the beginning of the rendering loop |
| frameTime | the time elapsed since last frame |
Implements Animation.
|
overridevirtual |
Apply the animation transformation to the input vector.
| v | the vector to transform |
| fullTime | the time elapsed since the beginning of the rendering loop |
| frameTime | the time elapsed since last frame |
Implements Animation.
| bool BackAndForth::decode | ( | const KeyValues & | params | ) |
Setup back-and-forth translation animation parameters from a key-value tuple. The expected format is as follows:
backandforth: speed frame axisX,axisY,axisZ amplitude
(where frame is one of 'world' or 'model').
| params | the parameters tuple |
|
overridevirtual |
Generate a key-values representation of the animation. See decode for the keywords and layout.
Reimplemented from Animation.