]> git.tdb.fi Git - libs/gl.git/blobdiff - source/keyframe.h
Have Object provide an identity matrix from get_matrix
[libs/gl.git] / source / keyframe.h
index 6a8c5a447e60ab8c5f0575f47854e9019e145090..7854a928863c86ea7d2a30891d97a3687ac44b22 100644 (file)
@@ -30,10 +30,34 @@ public:
                void rotation(float, float, float, float);
                void scaling_uniform(float);
                void scaling(float, float, float);
+               void uniforms();
        };
 
+       class UniformsLoader: public DataFile::ObjectLoader<KeyFrame>
+       {
+       public:
+               UniformsLoader(KeyFrame &);
+
+       private:
+               void uniform1f(const std::string &, float);
+               void uniform2f(const std::string &, float, float);
+               void uniform3f(const std::string &, float, float, float);
+               void uniform4f(const std::string &, float, float, float, float);
+       };
+
+       struct AnimatedUniform
+       {
+               unsigned size;
+               float values[4];
+
+               AnimatedUniform(unsigned, float, float = 0.0f, float = 0.0f, float = 0.0f);
+       };
+
+       typedef std::map<std::string, AnimatedUniform> UniformMap;
+
 private:
        Matrix matrix;
+       UniformMap uniforms;
        RefPtr<const Pose> pose;
 
 public:
@@ -43,6 +67,7 @@ public:
        void set_matrix(const Matrix &);
        void set_pose(const Pose &);
        const Matrix &get_matrix() const { return matrix; }
+       const UniformMap &get_uniforms() const { return uniforms; }
        const Pose *get_pose() const { return pose.get(); }
 };