-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameObject.h
56 lines (37 loc) · 1.17 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include <directxmath.h>
#include <d3d11_1.h>
#include <string>
#include "Material.h"
#include "Geometry.h"
#include "Debug.h"
#include "Appearance.h"
#include "Transform.h"
#include "ParticleModel.h"
using namespace DirectX;
using namespace std;
class GameObject
{
public:
GameObject(string type, Geometry geometry, Material material);
~GameObject();
string GetType() const { return _type; }
string GetGameObjectType() { return _gObjectType; }
XMMATRIX GetWorldMatrix() const { return XMLoadFloat4x4(&_world); }
//get components
Appearance* GetAppearance() const { return _appearance; };
Transform* GetTransform () const { return _transform; };
ParticleModel* GetParticleModel() const { return _particleModel; };
void SetParent(GameObject * parent) { _parent = parent; }
void Update(float t);
void Draw(ID3D11DeviceContext * pImmediateContext);
private:
Appearance * _appearance = new Appearance();
Transform * _transform = new Transform();
ParticleModel * _particleModel = new ParticleModel(_transform, 1, true, Vector3(0,0,0), Vector3(0, 0, 0));
string _type;
string _gObjectType;
XMFLOAT4X4 _world;
Debug debug;
GameObject * _parent;
};