![]() |
scg3
0.6
|
An animation that creates a transformation to be applied to its sub-tree (composite node). More...
#include "TransformAnimation.h"
Public Member Functions | |
TransformAnimation () | |
virtual | ~TransformAnimation () |
GLfloat | getFloatParam () const |
TransformAnimation * | setFloatParam (GLfloat param) |
const glm::vec3 & | getVec3Param () const |
TransformAnimation * | setVec3Param (const glm::vec3 ¶m) |
const glm::mat4 & | getMat4Param () const |
TransformAnimation * | setMat4Param (const glm::mat4 ¶m) |
TransformAnimation * | setStartFunc (std::function< void(TransformAnimation *)> startFunc) |
TransformAnimation * | setUpdateFunc (std::function< void(TransformAnimation *, double, double, double)> updateFunc) |
virtual void | start (double currTime) |
virtual void | update (double currTime) |
![]() | |
Animation () | |
virtual | ~Animation () |
bool | isStarted () const |
bool | isRunning () const |
virtual void | stop () |
virtual void | reset () |
![]() | |
Transformation () | |
virtual | ~Transformation () |
const glm::mat4 & | getMatrix () const |
virtual Transformation * | setMatrix (const glm::mat4 &matrix) |
virtual Transformation * | translate (glm::vec3 translation) |
virtual Transformation * | rotateRad (GLfloat angleRad, glm::vec3 axis) |
virtual Transformation * | rotate (GLfloat angleDeg, glm::vec3 axis) |
virtual Transformation * | scale (glm::vec3 scaling) |
virtual void | accept (Traverser *traverser) |
virtual void | acceptPost (Traverser *traverser) |
virtual void | render (RenderState *renderState) |
virtual void | renderPost (RenderState *renderState) |
![]() | |
Composite () | |
virtual | ~Composite ()=0 |
virtual void | destroy () |
Composite * | addChild (NodeSP child) |
Composite * | removeChild (Node *node, bool &result) |
Composite * | removeChild (Node *node) |
virtual void | traverse (Traverser *traverser) |
![]() | |
Node () | |
virtual | ~Node ()=0 |
virtual void | clear () |
int | getNCores () const |
const std::string & | getMetaInfo (const std::string &key) const |
void | setMetaInfo (const std::string &key, const std::string &value) |
bool | isVisible () const |
void | setVisible (bool isVisible=true) |
Static Public Member Functions | |
static TransformAnimationSP | create () |
![]() | |
static TransformationSP | create () |
Protected Attributes | |
GLfloat | floatParam_ |
glm::vec3 | vec3Param_ |
glm::mat4 | mat4Param_ |
std::function< void(TransformAnimation *)> | startFunc_ |
std::function< void(TransformAnimation *, double, double, double)> | updateFunc_ |
![]() | |
bool | isStarted_ |
bool | isRunning_ |
double | lastTime_ |
double | diffTime_ |
double | totalTime_ |
![]() | |
glm::mat4 | matrix_ |
![]() | |
NodeSP | leftChild_ |
![]() | |
NodeSP | rightSibling_ |
Composite * | parent_ |
std::vector< CoreSP > | cores_ |
bool | isVisible_ |
std::unordered_map< std::string, std::string > | metaInfo_ |
Additional Inherited Members | |
![]() | |
void | addSibling_ (NodeSP sibling) |
void | removeSibling_ (Node *node, bool &result) |
void | processCores_ (RenderState *renderState) |
void | postProcessCores_ (RenderState *renderState) |
An animation that creates a transformation to be applied to its sub-tree (composite node).
The update function can be set as a function object for a global function, a member function (method) of a class, or a lambda function.
Example (lambda function):
Definition at line 63 of file TransformAnimation.h.
scg::TransformAnimation::TransformAnimation | ( | ) |
Constructor.
|
virtual |
Destructor.
|
static |
Create shared pointer.
GLfloat scg::TransformAnimation::getFloatParam | ( | ) | const |
Get parameter.
const glm::mat4& scg::TransformAnimation::getMat4Param | ( | ) | const |
Get parameter.
const glm::vec3& scg::TransformAnimation::getVec3Param | ( | ) | const |
Get parameter.
TransformAnimation* scg::TransformAnimation::setFloatParam | ( | GLfloat | param | ) |
Set parameter to be used by animation function.
TransformAnimation* scg::TransformAnimation::setMat4Param | ( | const glm::mat4 & | param | ) |
Set parameter to be used by animation function.
TransformAnimation* scg::TransformAnimation::setStartFunc | ( | std::function< void(TransformAnimation *)> | startFunc | ) |
Set start function f_start that is called when the animation is started as f(this).
startFunc | function object with signature void f(TransformAnimation*). |
TransformAnimation* scg::TransformAnimation::setUpdateFunc | ( | std::function< void(TransformAnimation *, double, double, double)> | updateFunc | ) |
Set update function that is called when the animation is updated as f(this, currTime, diffTime, totalTime) (cf. Animation).
updateFunc | function object with signature void f(TransformAnimation*, double, double, double). |
TransformAnimation* scg::TransformAnimation::setVec3Param | ( | const glm::vec3 & | param | ) |
Set parameter to be used by animation function.
|
virtual |
Start or restart animation with given time, call start function (if defined).
currTime | current time (seconds) |
Reimplemented from scg::Animation.
|
virtual |
Update animation with given time, call update function (if defined).
currTime | current time (seconds) |
Implements scg::Animation.
|
protected |
Definition at line 148 of file TransformAnimation.h.
|
protected |
Definition at line 150 of file TransformAnimation.h.
|
protected |
Definition at line 151 of file TransformAnimation.h.
|
protected |
Definition at line 152 of file TransformAnimation.h.
|
protected |
Definition at line 149 of file TransformAnimation.h.