-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcamera.go
40 lines (32 loc) · 992 Bytes
/
camera.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
package mcpiapi
import (
"fmt"
)
// Camera has methods for manipulating the scene displayed to the user.
type Camera object
// Mode returns the mode object for the camera
func (obj Camera) Mode() Mode {
return Mode(obj)
}
// Mode has methods for manipulating the camera mode.
type Mode object
// SetNormal sets the camera mode to the normal first-person view.
func (obj Mode) SetNormal() error {
s := "camera.mode.setNormal()"
return object(obj).send(s)
}
// SetThirdPerson sets the camera to the third-person view.
func (obj Mode) SetThirdPerson() error {
s := "camera.mode.setThirdPerson()"
return object(obj).send(s)
}
// SetFixed sets the camera to a fixed view. Use SetPos to move it around.
func (obj Mode) SetFixed() error {
s := "camera.mode.setFixed()"
return object(obj).send(s)
}
// SetPos moves the camera to the given coordinate.
func (obj Mode) SetPos(x, y, z int) error {
s := fmt.Sprintf("camera.mode.setPos(%d,%d,%d)", x, y, z)
return object(obj).send(s)
}