blob: ec867c54c1f2a50e11d3212b2141bfcb32c70f48 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/**
* @file camera.h
* @author your name (you@domain.com)
* @brief
* @version 0.1
* @date 2024-02-24
*
* @copyright Copyright (c) 2024
*
*/
#pragma once
#include "maths_types.h"
typedef struct camera {
vec3 position;
vec3 front;
vec3 up;
f32 fov;
} camera;
/** @brief create a camera */
camera camera_create(vec3 pos, vec3 front, vec3 up, f32 fov);
/** @brief get a 4x4 transform matrix for the view and perspective projection */
void camera_view_projection(camera *c, f32 screen_height, f32 screen_width, mat4 *out_view,
mat4 *out_proj);
// TODO: Basic reusable camera controls
/*
Right click + move = pan
Left click = orbit camera
WASD = forward/backward/left/right
*/
|