+void Model::calcBoneTransforms(aiNode &node, glm::mat4 parentTrans = glm::mat4(1), BoneTransforms boneTrans = BoneTransforms()) {
+ glm::mat4 animTrans(1.f);
+ if (animMap->count(std::string(ai.mName.C_Str()))) {
+ for (const Animation anim: animMap->at(std::string(ai.mName.C_Str()))) {
+ float t = fmod(tick, anim.duration);
+ for (const aiNodeAnim *nodeAnim: anim.nodeAnims) {
+ animTrans *= lerpPosition(nodeAnim, t);
+ animTrans *= lerpRotation(nodeAnim, t);
+ animTrans *= lerpScaling(nodeAnim, t);
+ }
+ }
+ }
+
+
+ glm::mat4 m = parentTrans * animTrans * aiMatrixToMat4(ai.mTransformation) * model;
+}
+