-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSceneObject.h
37 lines (32 loc) · 943 Bytes
/
SceneObject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include <glm\glm.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm\gtc\quaternion.hpp>
using namespace glm;
class SceneObject
{
public:
SceneObject(const vec3& positionVector = vec3(0.0f, 0.0f, 0.0f), const vec3& scaleVector = vec3(1.0f, 1.0f, 1.0f));
~SceneObject();
vec3 Position() const;
vec3 Forward() const;
vec3 Backward() const;
vec3 Right() const;
vec3 Left() const;
vec3 Up() const;
vec3 Down() const;
virtual void SetPosition(const vec3& positionVector);
void SetScale(const vec3& scaleVector);
void SetRotation(const vec3& rotationVector);
mat4 GetTransformationMatrix() const;
mat4 GetRotationMatrix();
void Move(const vec3& direction);
void Rotate(const vec3& direction, float angle);
void RotateAroundRight(float angle);
void RotateAroundUp(float angle);
void RotateAroundForward(float angle);
protected:
vec3 position;
vec3 scale;
quat rotation;
};