-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransform.h
39 lines (28 loc) · 1.15 KB
/
Transform.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
38
#pragma once
#include <directxmath.h>
#include <d3d11_4.h>
#include <string>
#include "Structures.h"
class Transform
{
private:
Vector3 _position;
Quaternion _orientation;
Vector3 _scale;
public:
Transform();
Transform(Vector3 _newPos, Quaternion _newRot, Vector3 _newScale);
~Transform();
// Setters and Getters for position/rotation/scale
void SetPosition(Vector3 position) { _position = position; }
void SetPosition(float x, float y, float z) { _position.x = x; _position.y = y; _position.z = z; }
Vector3 GetPosition() const { return _position; }
void SetScale(Vector3 scale) { _scale = scale; }
void SetScale(float x, float y, float z) { _scale.x = x; _scale.y = y; _scale.z = z; }
Vector3 GetScale() const { return _scale; }
void SetRotation(Vector3 rotation) { _orientation = MakeQFromEulerAngles(rotation.x, rotation.y, rotation.z); }
void SetRotation(float x, float y, float z) { _orientation = MakeQFromEulerAngles(x, y, z); }
void SetOrientation(Quaternion orientation) { _orientation = orientation; }
Vector3 GetRotation() const { return MakeEulerAnglesFromQ(_orientation); }
Quaternion GetOrientation() const { return _orientation; }
};