- std::string nodeName = pair.first;
- unsigned int boneId = pair.second.first;
- glm::mat4 boneOffset = pair.second.second;
-
- glm::mat4 boneTrans(1.f);
- if (boneTransforms.count(nodeName)) boneTrans = boneTransforms[nodeName];
- int j = 0;
- for (const Animation anim: animMap->at(nodeName)) {
- float t = fmod(tick, anim.duration);
- for (const aiNodeAnim *nodeAnim: anim.nodeAnims) {
- boneTrans = boneTrans * lerp(nodeAnim, t);
- boneTrans = boneTrans * lerpRotation(nodeAnim, t);
- /* boneTrans = boneTrans * lerpScaling(nodeAnim, t); */
- j++;
- }
- }
- assert(j == 1);