vrchess

diff src/vr/vr.c @ 10:e3f0ca1d008a

added preliminary OpenHMD module
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 22 Aug 2014 20:11:15 +0300
parents c2eecf764daa
children 5dc4e2b8f6f5
line diff
     1.1 --- a/src/vr/vr.c	Fri Aug 22 18:48:25 2014 +0300
     1.2 +++ b/src/vr/vr.c	Fri Aug 22 20:11:15 2014 +0300
     1.3 @@ -152,7 +152,17 @@
     1.4  
     1.5  int vr_view_matrix(int eye, float *mat)
     1.6  {
     1.7 -	/* TODO combine vr_view_translation and vr_view_rotation */
     1.8 +	float offs[3], quat[4];
     1.9 +
    1.10 +	if(vrm && vrm->view_matrix) {
    1.11 +		vrm->view_matrix(eye, mat);
    1.12 +		return 1;
    1.13 +	}
    1.14 +
    1.15 +	if(!vr_view_translation(eye, offs) && !vr_view_rotation(eye, quat)) {
    1.16 +		return 0;
    1.17 +	}
    1.18 +	/* TODO construct matrix */
    1.19  	return 0;
    1.20  }
    1.21