2022-04-21 16:29:05 +02:00

57 lines
1.1 KiB
C

#ifndef CAMERA_H
#define CAMERA_H
#include "utils.h"
#include <stdbool.h>
/**
* Camera, as a moving point with direction
*/
struct App;
typedef struct Camera
{
vec3f position;
vec3f rotation;
vec3f speed;
struct App *app;
} Camera;
/**
* Initialize the camera to the start position.
*/
void init_camera(Camera* camera);
/**
* Update the position of the camera.
*/
void update_camera(Camera* camera, struct App *app, double time);
/**
* Apply the camera settings to the view transformation.
*/
void set_view(const Camera* camera);
void set_view_fix(const Camera* camera);
/**
* Set the horizontal and vertical rotation of the view angle.
*/
void rotate_camera(Camera* camera, double horizontal, double vertical);
/**
* Set the speed of forward and backward motion.
*/
void camera_set_speed(Camera* camera, double speed);
void camera_set_vertical_speed(Camera* camera, double speed);
/**
* Set the speed of left and right side steps.
*/
void camera_set_side_speed(Camera* camera, double speed);
vec3f get_camera_dir_vec3f(Camera* camera);
#endif /* CAMERA_H */