Skip to content

Instantly share code, notes, and snippets.

@alanhaugen
Created August 31, 2020 08:56
Show Gist options
  • Save alanhaugen/8e439048a481878b99e5a0a055afec8c to your computer and use it in GitHub Desktop.
Save alanhaugen/8e439048a481878b99e5a0a055afec8c to your computer and use it in GitHub Desktop.
#include "keyframe.h"
KeyFrame::KeyFrame()
: interpolation(0),
timestamp(0),
transforms()
{
}
KeyFrame::KeyFrame(int interpolation_, float timestamp_)
: interpolation(interpolation_),
timestamp(timestamp_),
transforms()
{
transforms.Resize(MAX_JOINTS);
}
void KeyFrame::CalculateTransform()
{
for (unsigned int i = 0; i < transforms.Size(); i++)
{
transforms[i].Scale(transforms[i].scale);
transforms[i].Translate(transforms[i].position);
transforms[i].Rotate(transforms[i].rotation);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment