#include <msp/datafile/collection.h>
#include "keyframe.h"
#include "pose.h"
-#include "transform.h"
using namespace std;
KeyFrame::~KeyFrame()
{ }
+void KeyFrame::set_transform(const Transform &t)
+{
+ transform = t;
+}
+
void KeyFrame::set_matrix(const Matrix &m)
{
- matrix = m;
+ transform = Transform::from_matrix(m);
}
void KeyFrame::set_pose(const Pose &p)
void KeyFrame::Loader::position(float x, float y, float z)
{
- obj.matrix.translate(x, y, z);
+ obj.transform.set_position(Vector3(x, y, z));
}
void KeyFrame::Loader::rotation(float a, float x, float y, float z)
{
- obj.matrix.rotate_deg(a, x, y, z);
+ obj.transform.set_rotation(Transform::Angle::from_degrees(a), Vector3(x, y, z));
}
void KeyFrame::Loader::scaling_uniform(float s)
{
- obj.matrix.scale(s);
+ obj.transform.set_scale(s);
}
void KeyFrame::Loader::scaling(float x, float y, float z)
{
- obj.matrix.scale(x, y, z);
+ obj.transform.set_scale(Vector3(x, y, z));
}
void KeyFrame::Loader::transform()
{
- Transform trn;
- load_sub(trn);
- obj.matrix = trn.to_matrix();
+ load_sub(obj.transform);
}
void KeyFrame::Loader::uniforms()
#include <msp/core/refptr.h>
#include <msp/datafile/objectloader.h>
#include "matrix.h"
+#include "transform.h"
namespace Msp {
namespace GL {
typedef std::map<std::string, AnimatedUniform> UniformMap;
private:
- Matrix matrix;
+ Transform transform;
UniformMap uniforms;
RefPtr<const Pose> pose;
KeyFrame();
~KeyFrame();
+ void set_transform(const Transform &);
void set_matrix(const Matrix &);
void set_pose(const Pose &);
- const Matrix &get_matrix() const { return matrix; }
+ const Transform &get_transform() const { return transform; }
+ Matrix get_matrix() const { return transform.to_matrix(); }
const UniformMap &get_uniforms() const { return uniforms; }
const Pose *get_pose() const { return pose.get(); }
};