istereo2

annotate src/cam.h @ 30:900651a2f401

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 08 Oct 2015 06:54:18 +0300
parents
children
rev   line source
nuclear@2 1 /*
nuclear@2 2 Stereoscopic tunnel for iOS.
nuclear@2 3 Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org>
nuclear@2 4
nuclear@2 5 This program is free software: you can redistribute it and/or modify
nuclear@2 6 it under the terms of the GNU General Public License as published by
nuclear@2 7 the Free Software Foundation, either version 3 of the License, or
nuclear@2 8 (at your option) any later version.
nuclear@2 9
nuclear@2 10 This program is distributed in the hope that it will be useful,
nuclear@2 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@2 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@2 13 GNU General Public License for more details.
nuclear@2 14
nuclear@2 15 You should have received a copy of the GNU General Public License
nuclear@2 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@2 17 */
nuclear@2 18
nuclear@2 19 #ifndef CAM_H_
nuclear@2 20 #define CAM_H_
nuclear@2 21
nuclear@2 22 enum {
nuclear@2 23 CAM_CENTER,
nuclear@2 24 CAM_LEFT,
nuclear@2 25 CAM_RIGHT
nuclear@2 26 };
nuclear@2 27
nuclear@2 28 /* reset to the initial state */
nuclear@2 29 void cam_reset(void); /* all */
nuclear@2 30 void cam_reset_view(void); /* view parameters */
nuclear@2 31 void cam_reset_proj(void); /* projection parameters */
nuclear@2 32 void cam_reset_stereo(void); /* stereo parameters */
nuclear@2 33
nuclear@2 34 /* camera viewing parameters */
nuclear@2 35 void cam_pan(int dx, int dy); /* pan across X/Z plane */
nuclear@2 36 void cam_height(int dh); /* move verticaly */
nuclear@2 37 void cam_rotate(int dx, int dy); /* rotate around local Y and X axis */
nuclear@2 38 void cam_zoom(int dz); /* dolly the camera fwd/back */
nuclear@2 39
nuclear@2 40 /* camera projection parameters */
nuclear@2 41 void cam_clip(float n, float f); /* set clipping planes */
nuclear@2 42 void cam_fov(float f); /* vertical field of view in degrees */
nuclear@2 43 void cam_aspect(float a); /* aspect ratio (width / height) */
nuclear@2 44
nuclear@2 45 /* stereo parameters */
nuclear@2 46 void cam_separation(float s);
nuclear@2 47 void cam_focus_dist(float d);
nuclear@2 48
nuclear@2 49 /* multiply the camera view matrix on top of the current matrix stack
nuclear@2 50 * (which should be GL_MODELVIEW)
nuclear@2 51 */
nuclear@2 52 void cam_view_matrix(void);
nuclear@2 53 void cam_stereo_view_matrix(int eye);
nuclear@2 54
nuclear@2 55 /* multiply the camera projection matrix on top of the current matrix stack
nuclear@2 56 * (which should be GL_PROJECTION)
nuclear@2 57 */
nuclear@2 58 void cam_proj_matrix(void);
nuclear@2 59 void cam_stereo_proj_matrix(int eye);
nuclear@2 60
nuclear@2 61 #endif /* CAM_H_ */