-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameObject.cpp
More file actions
47 lines (42 loc) · 1.01 KB
/
GameObject.cpp
File metadata and controls
47 lines (42 loc) · 1.01 KB
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
#include "GameObject.h"
#include <d3dx9.h>
GameObject::GameObject(Model*& model, Point position)
{
this->object_model = model;
this->object_position = position;
this->object_scale.x = 1;
this->object_scale.y = 1;
this->object_scale.z = 1;
}
GameObject::GameObject(Model*& model, Point position, Point scale)
{
this->object_model = model;
this->object_position = position;
this->object_scale = scale;
}
GameObject::GameObject(Model*& model, Point position, float scale)
{
this->object_model = model;
this->object_position = position;
this->object_scale.x = scale;
this->object_scale.y = scale;
this->object_scale.z = scale;
}
GameObject::~GameObject()
{
delete this->object_model;
}
void GameObject::draw(float rx, float ry, float rz)
{
if(object_model != NULL)
{
object_model->draw(
object_position.x, object_position.y, object_position.z,
rx, ry, rz,
object_scale.x, object_scale.y, object_scale.z);
}
}
void GameObject::draw()
{
draw(0, 0, 0);
}