forked from MajorHard/vraylib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
camera.v
49 lines (39 loc) · 1.42 KB
/
camera.v
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
module vraylib
//------------------------------------------------------------------------------------
// Camera System Functions (Module: camera)
//------------------------------------------------------------------------------------
pub const (
camera_custom_mode = 0
camera_free_mode = 1
camera_orbital_mode = 2
camera_first_person_mode = 3
camera_third_person_mode = 4
)
pub const (
camera_perspective = 0
camera_orthographic = 1
)
// Set camera mode (multiple camera modes available)
[inline] pub fn set_camera_mode(camera Camera3D, mode int) {
C.SetCameraMode(camera, mode)
}
// Update camera position for selected mode
[inline] pub fn update_camera(camera &Camera3D) {
C.UpdateCamera(camera)
}
// Set camera pan key to combine with mouse movement (free camera)
[inline] pub fn set_camera_pan_control(panKey int) {
C.SetCameraPanControl(panKey)
}
// Set camera alt key to combine with mouse movement (free camera)
[inline] pub fn set_camera_alt_control(altKey int) {
C.SetCameraAltControl(altKey)
}
// Set camera smooth zoom key to combine with mouse (free camera)
[inline] pub fn set_camera_smooth_zoom_control(szKey int) {
C.SetCameraSmoothZoomControl(szKey)
}
// Set camera move controls (1st person and 3rd person cameras)
[inline] pub fn set_camera_move_controls(frontKey, backKey, rightKey, leftKey, upKey, downKey int) {
C.SetCameraMoveControls(frontKey, backKey, rightKey, leftKey, upKey, downKey)
}