-
Notifications
You must be signed in to change notification settings - Fork 2
/
GameObject.java
47 lines (40 loc) · 987 Bytes
/
GameObject.java
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
/**
* Object which holds a mesh and a transform. This is used for any non stationary
* 3d object.
*/
public class GameObject
{
//the mesh of the object (a bunch of triangles)
private Mesh mesh;
//the transform of the object, which handles position and rotation.
private Transform transform;
//name
private String name;
public GameObject(String nameIn, Mesh meshIn, Transform transformIn)
{
mesh = meshIn;
name = nameIn;
transformIn.setGameObject(this);
transform = transformIn;
}
//#region getter methods
public Mesh getMesh()
{
return mesh;
}
//returns the transform object
public Transform getTransform()
{
return transform;
}
public String getName()
{
return name;
}
public void setTransform(Transform transformIn)
{
transform = transformIn;
transform.setGameObject(this);
}
//#endregion
}