1 /************************************************************************
3 * voxelands - 3d voxel world sandbox game
4 * Copyright (C) Lisa 'darkrose' Milne 2016 <lisa@ltmnet.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>
18 ************************************************************************/
21 #define _WM_EXPOSE_ALL
24 static camera_t camera
= {
32 /* move to the camera position */
33 void camera_view_matrix(matrix_t
*mat
, camera_t
*cam
)
38 matrix_translate(mat
,-cam
->x
, -cam
->y
, -cam
->z
);
39 matrix_rotate_deg_y(mat
,-cam
->yaw
);
40 matrix_rotate_deg_x(mat
,cam
->pitch
);
43 /* get the camera data */
44 camera_t
*camera_get()
49 /* set the position of the camera */
50 void camera_set_pos(v3_t
*p
)
57 /* set the yaw - y rotation - of the camera */
58 void camera_set_yaw(GLfloat yaw
)
63 /* set the pitch - x rotation - of the camera */
64 void camera_set_pitch(GLfloat pitch
)