-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameObject.h
41 lines (30 loc) · 873 Bytes
/
GameObject.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
#pragma once
#include <d3d11_1.h>
#include <DirectXMath.h>
#include "Structures.h"
#include "Camera.h"
class GameObject
{
private:
MeshData _meshData;
Material _material;
XMFLOAT4X4 _trans;
XMFLOAT4X4 _rot;
XMFLOAT4X4 _scale;
XMFLOAT4X4 _world;
public:
GameObject();
void Update();
void SetMeshData(MeshData newMeshData) { _meshData = newMeshData; }
void SetMaterial(Material newMaterial) { _material = newMaterial; }
void SetWorld(XMFLOAT4X4 newWorld) { _world = newWorld; }
void SetPosition(XMFLOAT3 newPosition);
void SetRotation(XMFLOAT3 newRotation);
void SetScale(XMFLOAT3 newScale);
void RotateOnAxes(XMFLOAT3 rotationDegrees);
MeshData* GetMeshData() { return &_meshData; }
Material* GetMaterial() { return &_material; }
XMFLOAT4X4* GetWorld() { return &_world; }
XMFLOAT3 GetPosition();
float GetDistanceToCamera(Camera* camera);
};