-
Notifications
You must be signed in to change notification settings - Fork 0
/
node_content.go
50 lines (41 loc) · 900 Bytes
/
node_content.go
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
package opengl
type nodeContent struct {
model Model
cam Camera
}
func createNodeContentWithModel(
model Model,
) NodeContent {
return createNodeContentInternally(model, nil)
}
func createNodeContentWithCamera(
cam Camera,
) NodeContent {
return createNodeContentInternally(nil, cam)
}
func createNodeContentInternally(
model Model,
cam Camera,
) NodeContent {
out := nodeContent{
model: model,
cam: cam,
}
return &out
}
// IsModel returns true if there is a model, false otherwise
func (obj *nodeContent) IsModel() bool {
return obj.model != nil
}
// Model returns the model, if any
func (obj *nodeContent) Model() Model {
return obj.model
}
// IsCamera returns true if there is a camera, false otherwise
func (obj *nodeContent) IsCamera() bool {
return obj.cam != nil
}
// Camera returns the camera, if any
func (obj *nodeContent) Camera() Camera {
return obj.cam
}