oculus2_psprite

diff src/main.c @ 8:4d6733229e01

porting to 0.4.3 (finally on linux)
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 25 Oct 2014 20:07:24 +0300
parents cd9f1560b909
children 9c36ae39ad95
line diff
     1.1 --- a/src/main.c	Thu Sep 04 09:01:01 2014 +0300
     1.2 +++ b/src/main.c	Sat Oct 25 20:07:24 2014 +0300
     1.3 @@ -257,10 +257,13 @@
     1.4  		 * we need to construct a view matrix by combining all the information provided by the oculus
     1.5  		 * SDK, about the position and orientation of the user's head in the world.
     1.6  		 */
     1.7 -		pose[eye] = ovrHmd_GetEyePose(hmd, eye);
     1.8 +		/* TODO: use ovrHmd_GetEyePoses out of the loop instead */
     1.9 +		pose[eye] = ovrHmd_GetHmdPosePerEye(hmd, eye);
    1.10  		glMatrixMode(GL_MODELVIEW);
    1.11  		glLoadIdentity();
    1.12 -		glTranslatef(eye_rdesc[eye].ViewAdjust.x, eye_rdesc[eye].ViewAdjust.y, eye_rdesc[eye].ViewAdjust.z);
    1.13 +		glTranslatef(eye_rdesc[eye].HmdToEyeViewOffset.x,
    1.14 +				eye_rdesc[eye].HmdToEyeViewOffset.y,
    1.15 +				eye_rdesc[eye].HmdToEyeViewOffset.z);
    1.16  		/* retrieve the orientation quaternion and convert it to a rotation matrix */
    1.17  		quat_to_matrix(&pose[eye].Orientation.x, rot_mat);
    1.18  		glMultMatrixf(rot_mat);
    1.19 @@ -540,4 +543,4 @@
    1.20  	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, GL_RGB, GL_UNSIGNED_BYTE, img);
    1.21  
    1.22  	return tex;
    1.23 -}
    1.24 \ No newline at end of file
    1.25 +}