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
)
36 matrix_rotate_deg_x(mat
,camera
.pitch
);
37 matrix_rotate_deg_y(mat
,-camera
.yaw
);
38 matrix_translate(mat
,-camera
.x
, -camera
.y
, -camera
.z
);
41 /* get the camera data */
42 camera_t
*camera_get()
47 /* set the position of the camera */
48 void camera_set_pos(v3_t
*p
)
55 /* set the yaw - y rotation - of the camera */
56 void camera_set_yaw(GLfloat yaw
)
61 /* set the pitch - x rotation - of the camera */
62 void camera_set_pitch(GLfloat pitch
)