The Pose palette generation
The final optimization you should think about is the process of generating a matrix palette from Pose
. If you look at the Pose
class, the following bit of code converts a pose into a linear array of matrices:
void Pose::GetMatrixPalette(std::vector<mat4>& out) { unsigned int size = Size(); if (out.size() != size) { out.resize(size); } for (unsigned int i = 0; i < size; ++i) { Transform t = GetGlobalTransform(i); out[i] = transformToMat4(t); } }
By itself, this function isn't too bad, but the GetGlobalTransform
function loops through every joint all the way up the specified joints transform chain until the root joint. This means the function wastes a considerable amount of...