From 4d2cc08aae8d7cb6ecb565c13091ddc50e894413 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 8 Jun 2019 09:47:00 +0300 Subject: [PATCH] Add a setter for KeyFrame uniforms --- source/keyframe.cpp | 6 ++++++ source/keyframe.h | 1 + 2 files changed, 7 insertions(+) diff --git a/source/keyframe.cpp b/source/keyframe.cpp index 8eba1729..856b85d6 100644 --- a/source/keyframe.cpp +++ b/source/keyframe.cpp @@ -24,6 +24,12 @@ void KeyFrame::set_matrix(const Matrix &m) transform = Transform::from_matrix(m); } +void KeyFrame::set_uniform(const string &n, const AnimatedUniform &u) +{ + uniforms.erase(n); + uniforms.insert(UniformMap::value_type(n, u)); +} + void KeyFrame::set_pose(const Pose &p) { pose = &p; diff --git a/source/keyframe.h b/source/keyframe.h index 4b985ca7..5b748add 100644 --- a/source/keyframe.h +++ b/source/keyframe.h @@ -68,6 +68,7 @@ public: void set_transform(const Transform &); void set_matrix(const Matrix &); + void set_uniform(const std::string &, const AnimatedUniform &); void set_pose(const Pose &); const Transform &get_transform() const { return transform; } Matrix get_matrix() const { return transform.to_matrix(); } -- 2.45.2