OpenPolygon  1.0.0
OpenPolygon is a Rendering Engine
animation.h
1 /*
2  Copyright (C) 2014 - 2016 Mutzii
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 */
18 #ifndef ANIMATION_H
19 #define ANIMATION_H
20 
21 #include "index.h"
22 #include "bone.h"
23 #include "Interface/IShader.h"
24 
25 namespace Engine
26 {
27 
32  class Animation : public Arch::IComponent
33  {
34  public:
35 
40  Animation();
41 
47  Animation(const std::string & animation_name );
48 
53 
59  void setFrames( int frame_amount );
60 
66  void setFrame( uint frame );
67 
73  void setBones ( Bones bones );
74 
75  void setData( float * data , int size );
76  float * getData(void);
77  void createData( int size );
78 
84  void addBone( Bone * bone );
85 
91  int getFrames(void);
92 
98  int getFrame(void);
99 
106  Bone * getBone( const std::string & bone_name );
107 
113  Bones getBones(void);
114 
121  int getBoneIndexByName( const std::string & bone_name );
122 
127  void Loop( void );
128 
134  DEPRECATED void BindMatricen( IShader * shader );
135 
141  void setTransforms( TransformMap map );
142 
143  TransformMap getTransforms(void);
144 
145  void setAnimationName( const std::string & animation_name );
146 
147 
148  private:
149 
150  TransformMap m_transform_map;
151 
152  Bones mBones;
153  std::string mName;
154  int mFrames;
155  int mFrame;
156  float * m_data;
157  float mFrameTimer;
158  };
159 }
160 
161 #endif // ANIMATION_H
The Bone class.
Definition: bone.h:34
Definition: element.h:23
Bones getBones(void)
getBones
Definition: Animation.cpp:95
~Animation()
Definition: animation.h:52
The IShader - abstract / interface class.
Definition: IShader.h:30
void Loop(void)
Loop.
Definition: Animation.cpp:125
Bone * getBone(const std::string &bone_name)
getBone
Definition: Animation.cpp:69
DEPRECATED void BindMatricen(IShader *shader)
sendMatricen
Definition: Animation.cpp:133
int getBoneIndexByName(const std::string &bone_name)
getBoneIndexByName
Definition: Animation.cpp:80
void addBone(Bone *bone)
addBone
Definition: Animation.cpp:54
void setFrames(int frame_amount)
setFrames
Definition: Animation.cpp:44
void setFrame(uint frame)
setFrame
Definition: Animation.cpp:39
void setTransforms(TransformMap map)
setTransforms
Definition: Animation.cpp:100
Animation()
Animation.
Definition: Animation.cpp:22
int getFrame(void)
getFrame
Definition: Animation.cpp:64
int getFrames(void)
getFrames
Definition: Animation.cpp:59
void setBones(Bones bones)
setBones
Definition: Animation.cpp:49
The Animation class.
Definition: animation.h:32