-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransform.h
39 lines (27 loc) · 998 Bytes
/
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
39
#pragma once
#include <directxmath.h>
#include <d3d11_1.h>
#include "Vector3.h"
using namespace DirectX;
using namespace std;
class Transform
{
private:
Vector3 _position;
Vector3 _rotation;
Vector3 _scale;
XMFLOAT4X4 _world;
public:
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) { _rotation = rotation; }
void SetRotation(float x, float y, float z) { _rotation.x = x; _rotation.y = y; _rotation.z = z; }
Vector3 GetRotation() const { return _rotation; }
XMMATRIX GetWorldMatrix() const { return XMLoadFloat4x4(&_world); }
};