22 #include <assimp/scene.h> 24 #include <BoneMatrices.h> 25 #include <assimp/Importer.hpp> 26 #include "linmath/float3.h" 28 #include "assimp/material.h" 74 double getCurrentAnimationTick(
float totalElapsedTimeInSeconds)
const;
80 void readNodeHierarchyAndUpdateBoneTransformations(
float currentAnimationTick, aiNode *currentAssimpNode,
81 chag::float4x4 parentMatrix);
86 void updateBoneTransformation(
const std::string &nodeName,
const chag::float4x4 &globalTransformation);
91 bool nodeIsABone(
const std::string &nodeName)
const;
93 chag::float4x4 getCurrentNodeTransformation(
float currentAnimationTick,
const aiNode *currentAssimpNode,
94 const std::string nodeName);
104 chag::float4x4 getInterpolatedAnimationMatrix(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
114 chag::float4x4 getInterpolatedTranslationMatrix(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
115 chag::float4x4 getInterpolatedRotationMatrix(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
116 chag::float4x4 getInterpolatedScalingMatrix(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
122 const aiNodeAnim *getAnimationNode(
const std::string &nodeName);
127 const aiNodeAnim* findNodeAnim(
const aiAnimation* animation,
const std::string nodeName);
137 aiVector3D calculateScalingInterpolation(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
138 aiQuaternion calculateRotationInterpolation(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
139 aiVector3D calculateTranslationInterpolation(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
150 unsigned int findScalingIndexRightBeforeTick(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
151 unsigned int findRotationIndexRightBeforeTick(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
152 unsigned int findTranslationIndexRightBeforeTick(
float currentAnimationTick,
const aiNodeAnim *nodeAnimation);
156 chag::float4x4 globalInverseTransform;
157 std::map<std::string, int> boneNameToIndexMapping;
158 std::vector<BoneMatrices*> boneInfos;
159 const aiScene *assimpScene;