Court is now in session

This commit is contained in:
2021-05-06 21:13:37 -07:00
parent f5522d64a7
commit 4a3b6c2f98
15 changed files with 150 additions and 24 deletions

View File

@ -10,6 +10,7 @@
void cameraLookAt(camera_t *camera,
float x, float y, float z, float targetX, float targetY, float targetZ
) {
glm_mat4_identity(camera->view);
glm_lookat(
(vec3){ x, y, z },
(vec3){ targetX, targetY, targetZ },
@ -22,6 +23,7 @@ void cameraLook(camera_t *camera,
float x, float y, float z,
float pitch, float yaw, float roll
) {
glm_mat4_identity(camera->view);
glm_look(
(vec3){ x, y, z },
(vec3){ pitch, yaw, roll },
@ -33,11 +35,13 @@ void cameraLook(camera_t *camera,
void cameraPerspective(camera_t *camera,
float fov, float aspect, float near, float far
) {
glm_perspective(fov, aspect, near, far, camera->projection);
glm_mat4_identity(camera->projection);
glm_perspective(mathDeg2Rad(fov), aspect, near, far, camera->projection);
}
void cameraOrtho(camera_t *camera,
float left, float right, float bottom, float top, float near, float far
) {
glm_mat4_identity(camera->projection);
glm_ortho(left, right, bottom, top, near, far, camera->projection);
}