AmbientOcclusion
SceneObject.h
Go to the documentation of this file.
1 #ifndef SCENEOBJECT_H
2 #define SCENEOBJECT_H
3 
4 #include <QMatrix4x4>
5 #include <QVector4D>
6 
7 
9 {
10 public:
11  SceneObject(QMatrix4x4 _modelMatrix);
12 
13  virtual ~SceneObject();
14 
15  QMatrix4x4 modelMatrix;
16  // Rotates the object around the x-axis in model space
17  void rotateX(float angle);
18  // Rotates the object around the y-axis in model space
19  void rotateY(float angle);
20  // Rotates the object around the z-axis in model space
21  void rotateZ(float angle);
22 
23  // Rotates the object around the x-axis in world space.
24  void rotateX_World(float angle);
25  // Rotates the object around the y-axis in world space
26  void rotateY_World(float angle);
27  // Rotates the object around the z-axis in world space
28  void rotateZ_World(float angle);
29  // Translates the object along the given direction
30  void translate(QVector3D direction);
31 
32  //setter position
33  void setPosition(QVector3D newPos);
34 
35 private:
36 
37  static QMatrix4x4 createRotationMatrix(float angle, QVector3D dim) {
38 
39  QMatrix4x4 rotationMatrix = QMatrix4x4();
40 
41  rotationMatrix.rotate(angle, dim);
42  return rotationMatrix;
43  }
44 
45 };
46 
47 #endif // SCENEOBJECT_H
void rotateZ(float angle)
Definition: SceneObject.cpp:25
void rotateX_World(float angle)
Definition: SceneObject.cpp:33
void rotateX(float angle)
Definition: SceneObject.cpp:13
virtual ~SceneObject()
Definition: SceneObject.cpp:8
void rotateY(float angle)
Definition: SceneObject.cpp:19
void translate(QVector3D direction)
Definition: SceneObject.cpp:51
void setPosition(QVector3D newPos)
Definition: SceneObject.cpp:56
Definition: SceneObject.h:8
SceneObject(QMatrix4x4 _modelMatrix)
Definition: SceneObject.cpp:3
void rotateZ_World(float angle)
Definition: SceneObject.cpp:45
QMatrix4x4 modelMatrix
Definition: SceneObject.h:15
void rotateY_World(float angle)
Definition: SceneObject.cpp:39