-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSceneGraphObject.java
68 lines (59 loc) · 1.41 KB
/
SceneGraphObject.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* This code is from exercise sheet written by Dr. Steve Maddock */
/*
the abstract class generate objects organised by scene graph
*/
import com.jogamp.opengl.GL3;
abstract class SceneGraphObject {
public GL3 gl3;
public Camera camera;
public Light light1, light2;
public MovingLight movingLight;
/**
* constructor
*
* @param gl3 GL3 parameter
* @param camera Camera parameter
* @param light1 Light parameter
* @param light2 Light parameter
* @param movingLight MovingLight parameter
*/
public SceneGraphObject(GL3 gl3, Camera camera, Light light1, Light light2, MovingLight movingLight) {
this.gl3 = gl3;
this.camera = camera;
this.light1 = light1;
this.light2 = light2;
this.movingLight = movingLight;
}
/**
* initialise model
*/
abstract void initialise();
/**
* build scene graph
*/
abstract void buildTree();
/**
* update scene graph
*/
abstract void update();
/**
* execute three functions above
*/
public void execute() {
initialise();
buildTree();
update();
}
/**
* dispose buffer
*
* @param gl3 GL3 element
*/
abstract void dispose(GL3 gl3);
/**
* render the object
*
* @param gl3 GL3 parameter
*/
public abstract void draw(GL3 gl3);
}