OpenPolygon  1.0.0
OpenPolygon is a Rendering Engine
position.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 POSITION_H
19 #define POSITION_H
20 
21 #include "index.h"
22 
23 namespace Engine
24 {
29  class Position : public Arch::IComponent
30  {
31  public:
32 
33  Position();
34  Position( const std::string & component_name );
35  virtual ~Position() = default;
36 
42  void setPosition( const Vector3f & position );
43 
49  void setRotation( const Vector3f & rotation );
50 
56  void setScale( const Vector3f & scale );
57 
63  void setQuanternion( const Vector4f & quant );
64 
70  void setMatrix( const glm::mat4 & model_matrix );
71 
77  const Vector3f & getPosition(void) const;
78 
84  const Vector3f & getRotation(void) const;
85 
91  const Vector3f & getScale(void) const;
92 
98  const Vector4f & getQuanternion(void) const;
99 
105  glm::quat getQuat() const;
106 
107 
108  glm::mat4 getTranslationMatrix( glm::vec3 vector );
113  glm::mat4 getTranslationMatrix(void) const;
114 
120  glm::mat4 getRotationMatrix(void) const;
121  glm::mat4 getRotationMatrix( const Vector3f & vector );
122 
128  glm::mat4 getMatrix(void) const;
129 
136  glm::mat4 getNormalMatrix( glm::mat4 model_view ) const;
137 
142  void camtransformation(void);
143 
148  void transformation(void);
149 
150  private:
151 
152  glm::mat4 mModelMatrix;
153  Vector3f mPosition;
154  Vector3f mRotation;
155  Vector3f mScale;
156  Vector4f mQuanternion;
157  };
158 
159 }
160 #endif // ENTITYPOSITION_H
glm::mat4 getRotationMatrix(void) const
getRotationMatrix
Definition: Position.cpp:138
glm::mat4 getNormalMatrix(glm::mat4 model_view) const
getNormalMatrix
Definition: Position.cpp:105
glm::mat4 getTranslationMatrix(void) const
getTranslationMatrix
Definition: Position.cpp:115
void setRotation(const Vector3f &rotation)
setRotation
Definition: Position.cpp:50
const Vector4f & getQuanternion(void) const
getQuanternion
Definition: Position.cpp:95
void camtransformation(void)
camtransformation
Definition: Position.cpp:149
const Vector3f & getScale(void) const
getScale
Definition: Position.cpp:90
Definition: element.h:23
const Vector3f & getRotation(void) const
getRotation
Definition: Position.cpp:85
const Vector3f & getPosition(void) const
getPosition
Definition: Position.cpp:80
void setScale(const Vector3f &scale)
setScale
Definition: Position.cpp:55
void setQuanternion(const Vector4f &quant)
setQuanternion
Definition: Position.cpp:61
void transformation(void)
transformation
Definition: Position.cpp:172
void setPosition(const Vector3f &position)
setPosition
Definition: Position.cpp:45
glm::quat getQuat() const
getQuat
Definition: Position.cpp:68
glm::mat4 getMatrix(void) const
getMatrix
Definition: Position.cpp:100
void setMatrix(const glm::mat4 &model_matrix)
setMatrix
Definition: Position.cpp:40
The Position class.
Definition: position.h:29