oculus1

view src/vr.h @ 11:39ec672a5158

added simple head model to the VR camera
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 20 Sep 2013 07:00:18 +0300
parents e2f9e4603129
children d797639e0234
line source
1 #ifndef VR_H_
2 #define VR_H_
4 /* VR mode init options */
5 enum vr_init_mode {
6 VR_INIT_NONE,
7 VR_INIT_OCULUS,
8 VR_INIT_STEREO
9 };
11 /* possible eye values */
12 enum {
13 VR_EYE_CENTER,
14 VR_EYE_LEFT,
15 VR_EYE_RIGHT
16 };
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
22 int vr_init(enum vr_init_mode mode);
23 void vr_shutdown(void);
25 float vr_get_fov(void);
26 float vr_get_aspect(void);
28 void vr_set_eyedist(float ipd);
29 float vr_get_eyedist(void);
31 /* expects an array of 4 barrel distortion coefficients:
32 * polar scale: k_0 + k_1 r^2 + k_2 r^4 + k_3 r^6
33 */
34 void vr_set_distort(const float *coef);
35 void vr_get_distort(float *coef);
37 void vr_set_prediction_sec(float dt);
38 float vr_get_prediction_sec(void);
40 void vr_get_view_matrix(float *res, int eye);
41 void vr_get_proj_matrix(float *res, int eye);
43 /* expects an array of at least 3 floats (x, y, z, offset). */
44 void vr_get_translation(float *offs);
45 /* expects an array of at least 4 floats (x, y, z, w, quaternion). */
46 void vr_get_rotation(float *quat);
47 /* expects an array of at least 3 floats (pitch, yaw, roll, angles). */
48 void vr_get_rotation_euler(float *euler);
50 /* OpenGL stuff */
51 void vr_draw_eye(unsigned int tex, int eye);
53 #ifdef __cplusplus
54 }
55 #endif
57 #endif /* VR_H_ */