-
-
Save alanhaugen/5e81a6ed6ce72c58565079a796ef2c0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "joint.h" | |
Joint::Joint(int _id, String _jointName, glm::mat4 _bindTransform) | |
{ | |
id = _id; | |
name = _jointName; | |
worldBindTransform = _bindTransform; | |
} | |
void Joint::CalculateInverseTransform(glm::mat4 parentWorldTransform) | |
{ | |
glm::mat4 localBindTransform = glm::inverse(parentWorldTransform) * worldBindTransform; | |
glm::mat4 bindTransform = parentWorldTransform * localBindTransform; | |
inverseBindTransform = glm::inverse(bindTransform); | |
for (unsigned int i = 0; i < children.Size(); i++) | |
{ | |
children[i]->CalculateInverseTransform(bindTransform); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment