From: Mikko Rasa Date: Sat, 8 Jun 2019 06:47:00 +0000 (+0300) Subject: Add a setter for KeyFrame uniforms X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=4d2cc08aae8d7cb6ecb565c13091ddc50e894413 Add a setter for KeyFrame uniforms --- 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(); }