Level H Engine
TransformComponent.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../Maths/Vec3.h"
4 #include "../Maths/Mat4.h"
5 #include "Component.h"
6 
11 {
12 
13 public:
17  virtual ~TransformComponent();
18 
23  Vec3 getPos() { return pos; }
24 
29  Vec3 getRotation() { return rotation; }
30 
35  Vec3 getScale() { return scaleSize; }
36 
41  void setPos(Vec3 inPos) { pos = inPos; }
42 
47  void setRotation(Vec3 inRotation) { rotation = inRotation; }
48 
53  void setScale(Vec3 inScaleSize) { scaleSize = inScaleSize; }
54 
60 
65  void rotate(Vec3 angles);
66 
71  void translate(Vec3 translation);
72 
77  void lookAt(Vec3 worldPosition);
78 
85  void rotateAround(Vec3 center, Vec3 axis, float amount);
86 
90  virtual void onAwake();
91 
95  virtual void onDestroy();
96 
97 private:
102 };
virtual void onAwake()
A virtual function for the componets awake.
Definition: TransformComponent.cpp:13
virtual ~TransformComponent()
A virtual destructor.
Definition: TransformComponent.cpp:9
Vec3 getRotation()
A function to get the rotation.
Definition: TransformComponent.h:29
A class that handles the components.
Definition: Component.h:13
void rotateAround(Vec3 center, Vec3 axis, float amount)
A function to rotate around a specific world point.
Definition: TransformComponent.cpp:45
void translate(Vec3 translation)
A function to translate the component.
Definition: TransformComponent.cpp:30
Vec3 getScale()
A function to get the scale.
Definition: TransformComponent.h:35
Vec3 rotation
Definition: TransformComponent.h:100
Vec3 pos
The vector transform variables.
Definition: TransformComponent.h:99
Vec3 getPos()
A function to get the position.
Definition: TransformComponent.h:23
Contains the Vec3 structure with functions and overloaded operators.
Definition: Vec3.h:8
Vec3 scaleSize
Definition: TransformComponent.h:101
void setRotation(Vec3 inRotation)
A function to set the rotation.
Definition: TransformComponent.h:47
Mat4 getTransformMat4()
A function to get the transform matrix.
Definition: TransformComponent.cpp:66
void lookAt(Vec3 worldPosition)
A function to look at a specific world position.
Definition: TransformComponent.cpp:37
void setScale(Vec3 inScaleSize)
A function to set the scale.
Definition: TransformComponent.h:53
virtual void onDestroy()
A virtual function for the componets destroy.
Definition: TransformComponent.cpp:19
void rotate(Vec3 angles)
A function to rotate the component.
Definition: TransformComponent.cpp:23
void setPos(Vec3 inPos)
A function to set the position.
Definition: TransformComponent.h:41
Contains the Mat4 structure with functions and overloaded operators. This is row major.
Definition: Mat4.h:9
A class that handles the transform component.
Definition: TransformComponent.h:10