scg3  0.6
TransformAnimation.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright 2014-2019 Volker Ahlers
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24 
25 #ifndef TRANSFORMANIMATION_H_
26 #define TRANSFORMANIMATION_H_
27 
28 #include <functional>
29 #include "scg_glew.h"
30 #include "Animation.h"
31 #include "scg_glm.h"
32 #include "scg_internals.h"
33 #include "Transformation.h"
34 
35 namespace scg {
36 
37 
64 
65 public:
66 
71 
75  virtual ~TransformAnimation();
76 
81 
85  GLfloat getFloatParam() const;
86 
91  TransformAnimation* setFloatParam(GLfloat param);
92 
96  const glm::vec3& getVec3Param() const;
97 
102  TransformAnimation* setVec3Param(const glm::vec3& param);
103 
107  const glm::mat4& getMat4Param() const;
108 
113  TransformAnimation* setMat4Param(const glm::mat4& param);
114 
121  TransformAnimation* setStartFunc(std::function<void(TransformAnimation*)> startFunc);
122 
130  TransformAnimation* setUpdateFunc(std::function<void(TransformAnimation*, double, double, double)> updateFunc);
131 
137  virtual void start(double currTime);
138 
144  virtual void update(double currTime);
145 
146 protected:
147 
148  GLfloat floatParam_;
149  glm::vec3 vec3Param_;
150  glm::mat4 mat4Param_;
151  std::function<void(TransformAnimation*)> startFunc_;
152  std::function<void(TransformAnimation*, double, double, double)> updateFunc_;
153 
154 };
155 
156 } /* namespace scg */
157 
158 #endif /* TRANSFORMANIMATION_H_ */
const glm::mat4 & getMat4Param() const
TransformAnimation * setVec3Param(const glm::vec3 &param)
Local header file for GLM OpenGL Mathematics library.
TransformAnimation * setStartFunc(std::function< void(TransformAnimation *)> startFunc)
An animation that creates a transformation to be applied to its sub-tree (composite node).
A transformation node to be used to appy a transformation to the sub-tree (composite node).
virtual void start(double currTime)
std::function< void(TransformAnimation *)> startFunc_
static TransformAnimationSP create()
Local header file for GLEW library.
GLfloat getFloatParam() const
Base class for all animations (abstract), providing general functionality.
Definition: Animation.h:34
TransformAnimation * setUpdateFunc(std::function< void(TransformAnimation *, double, double, double)> updateFunc)
Base class for all animations (abstract), providing general functionality.
TransformAnimation * setFloatParam(GLfloat param)
const glm::vec3 & getVec3Param() const
A transformation node to be used to appy a transformation to the sub-tree (composite node).
Definition: Animation.h:28
std::function< void(TransformAnimation *, double, double, double)> updateFunc_
Internal definitions required by most classes.
virtual void update(double currTime)
TransformAnimation * setMat4Param(const glm::mat4 &param)