OpenPolygon  1.0.0
OpenPolygon is a Rendering Engine
bone.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 BONE_H
19 #define BONE_H
20 
21 #include "index.h"
22 #include "keyframe.h"
23 #include "vertexgroup.h"
24 
25 namespace Engine
26 {
27  /* List of Keyframes */
28  using KeyFrames = std::vector< KeyFrame * >;
29 
34  class Bone
35  {
36  public:
37 
38  Bone();
39  explicit Bone(const std::string & bone_name );
40  ~Bone();
41 
47  void setParent( Bone * bone );
48 
54  void setName( const std::string & bone_name );
55 
61  void setOffsetPosition( const Vector3f & position );
62  void setOffset( const Vector3f & position );
63 
69  void setKeyFrames( KeyFrames frames );
70 
76  void setVertexGroup( VertexGroup * group );
77 
83  void addKeyFrame( KeyFrame * frame );
84 
90  const std::string & getName(void) const;
91 
97  const Vector3f & getPosition(void) const;
98 
104  const Vector3f & getOffset(void);
105 
111  KeyFrames getFrames(void) const;
112 
118  VertexGroup * getVertexGroup(void) const;
119 
125  Bone * getParent(void);
126 
127  private:
128 
129  std::string mName;
130  KeyFrames mFrames;
131  VertexGroup * mVertexGroup;
132  Vector3f mPosition;
133  Vector3f mOriginalPosition;
134  Bone * mParent;
135  };
136 }
137 
138 #endif // BONE_H
const std::string & getName(void) const
getName
Definition: Bone.cpp:98
VertexGroup * getVertexGroup(void) const
getVertexGroup
Definition: Bone.cpp:113
void setOffsetPosition(const Vector3f &position)
setOffsetPosition
Definition: Bone.cpp:68
const Vector3f & getOffset(void)
getOffset
Definition: Bone.cpp:78
The Bone class.
Definition: bone.h:34
The VertexGroup class.
Definition: vertexgroup.h:30
Definition: element.h:23
const Vector3f & getPosition(void) const
getPosition
Definition: Bone.cpp:103
KeyFrames getFrames(void) const
getFrames
Definition: Bone.cpp:108
void setKeyFrames(KeyFrames frames)
setKeyFrames
Definition: Bone.cpp:63
Bone * getParent(void)
getParent
Definition: Bone.cpp:93
void setVertexGroup(VertexGroup *group)
setVertexGroup
Definition: Bone.cpp:83
The KeyFrame class.
Definition: keyframe.h:30
void addKeyFrame(KeyFrame *frame)
addKeyFrame
Definition: Bone.cpp:88
void setParent(Bone *bone)
setParent
Definition: Bone.cpp:53
void setName(const std::string &bone_name)
setName
Definition: Bone.cpp:58