summaryrefslogtreecommitdiff
path: root/src/engine/M_camera.h
blob: 074bff5d906c5ea808be404128b99a841c0e3555 (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
#pragma once

#include <cglm/cglm.h>
#include <cglm/mat4.h>
#include <cglm/vec3.h>

enum M_CameraType {
	M_CAMERA_REGULAR = 0,
	M_CAMERA_FPS
};

typedef struct {
	vec3 pos;
	vec3 direction;
	vec3 up;

	float yaw, pitch, roll;

	unsigned short type;

	mat4 view_matrix;
} M_Camera;


typedef struct {
	vec3 pos;

	mat4 view_matrix;
} M_FPS_Camera;

void M_initCamera(M_Camera *camera, vec3 up);

//Generates the M_Camera's view matrix required for rendering
void M_cameraViewMatrix(M_Camera *camera);