AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Aire::Animator Class Reference

Class for playing the animation. More...

#include <animator.h>

Collaboration diagram for Aire::Animator:
Collaboration graph
[legend]

Public Member Functions

 Animator (Aire::MeshManager *meshManager, const std::string &animationPath, bool flippedUV)
 
 Animator (Animation *animation)
 
 ~Animator ()
 Delete the animator and free data of the animation.
 
glm::mat4 InterpolateMatrices (const glm::mat4 &matrix1, const glm::mat4 &matrix2, float blendFactor)
 
void UpdateAnimation (float dt)
 
void PlayAnimation (Animation *pAnimation)
 
void CalculateBoneTransform (const AssimpNodeData *node, glm::mat4 parentTransform, std::vector< glm::mat4 > &boneMatrices)
 
std::vector< glm::mat4 > GetFinalBoneMatrices ()
 get the bone matrices
 
void render (ShaderProgram &shader, Camera &camera)
 
void renderInstanced (ShaderProgram &shader, Camera &camera, glm::mat4 transform)
 

Public Attributes

bool isStatic = true
 Flag indicating whether the model is static.
 
Modelm_Model
 The animated model.
 
std::vector< Animation * > animations
 List of animations.
 

Detailed Description

Class for playing the animation.

Constructor & Destructor Documentation

◆ Animator() [1/2]

Aire::Animator::Animator ( Aire::MeshManager * meshManager,
const std::string & animationPath,
bool flippedUV )
inline

Constructor

Parameters
meshManagerThe mesh manager
animationPathThe path of the animation
flippedUVFlag to optionally flip the UVs of the mesh
Here is the call graph for this function:

◆ Animator() [2/2]

Aire::Animator::Animator ( Animation * animation)
inline

Constructor

Parameters
animationThe animation to run

Member Function Documentation

◆ CalculateBoneTransform()

void Aire::Animator::CalculateBoneTransform ( const AssimpNodeData * node,
glm::mat4 parentTransform,
std::vector< glm::mat4 > & boneMatrices )
inline

Calculate the bone transform

Parameters
nodeThe Assimp node
parentTransformTransform of the parent node
boneMatricesList to be filled with bone matrices
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFinalBoneMatrices()

std::vector< glm::mat4 > Aire::Animator::GetFinalBoneMatrices ( )
inline

get the bone matrices

Returns
bone matrix
Here is the caller graph for this function:

◆ InterpolateMatrices()

glm::mat4 Aire::Animator::InterpolateMatrices ( const glm::mat4 & matrix1,
const glm::mat4 & matrix2,
float blendFactor )
inline

Method to interpolate matrices. This is used when blending animations.

Parameters
matrix1The first matrix for blending
matrix2The second matrix for blending
blendFactorThe blend factor for the interpolation of the two matrices (value between 0 and 1)
Returns
The interpolated matrix
Here is the caller graph for this function:

◆ PlayAnimation()

void Aire::Animator::PlayAnimation ( Animation * pAnimation)
inline

Play the animation

Parameters
pAnimationanimation

◆ render()

void Aire::Animator::render ( ShaderProgram & shader,
Camera & camera )
inline

Render the animation

Parameters
shaderShader program to render the animation
cameraThe camera associated with the player
Here is the call graph for this function:

◆ renderInstanced()

void Aire::Animator::renderInstanced ( ShaderProgram & shader,
Camera & camera,
glm::mat4 transform )
inline

Render an instance of the animation

Parameters
shaderShader program to use for rendering
cameraThe camera associated with the player
transformTransform for the model instance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateAnimation()

void Aire::Animator::UpdateAnimation ( float dt)
inline

Update the animation informaiton accroding to the time

Parameters
dttime Time delta to drive the animation
Here is the call graph for this function:

The documentation for this class was generated from the following file: