-
Notifications
You must be signed in to change notification settings - Fork 1
/
C_Transform.h
51 lines (37 loc) · 1022 Bytes
/
C_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
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include "Component.h"
#include "MathGeoLib/include/MathGeoLib.h"
#include "ImGuizmo/ImGuizmo.h"
#include "Gizmo.h"
#ifdef _DEBUG
#pragma comment (lib, "lib/MathGeoLib/libx86/Debug/MathGeoLib.lib")
#else
#pragma comment (lib, "lib/MathGeoLib/libx86/Release/MathGeoLib.lib")
#endif
class C_Transform : public Component
{
public:
C_Transform(GameObject* gameobject, Component_Type type);
~C_Transform();
bool Enable();
bool Start();
void Update();
void UpdateMatrices();
bool Disable();
void Save(const char* gameObject, json &file);
void Load(const char* gameObject, const json &file);
public:
float4x4 transform;
mat4x4 globalMatrix;
mat4x4 globalMatrixTransposed;
mat4x4 localMatrix;
float4x4 f4x4_2_mat4x4;
float3 vposition = float3(0, 0, 0);
Quat vrotation = Quat(0, 0, 0, 0);
float3 vscale = float3(1, 1, 1);
float4x4 GetGlobalMatrix()const;
void SetGlobalMatrix(float4x4 transform);
//?
bool flipped_normals = false;
bool transform_updated = true;
};