2022-04-06 20:06:02 +02:00

52 lines
966 B
C

#ifndef CAMERA_H
#define CAMERA_H
#include "utils.h"
#include <stdbool.h>
/**
* Camera, as a moving point with direction
*/
typedef struct Camera
{
vec3f position;
vec3f rotation;
vec3f speed;
} Camera;
/**
* Initialize the camera to the start position.
*/
void init_camera(Camera* camera);
/**
* Update the position of the camera.
*/
void update_camera(Camera* camera, double time);
/**
* Apply the camera settings to the view transformation.
*/
void set_view(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 set_camera_speed(Camera* camera, double speed);
void camera_set_vertical_speed(Camera* camera, double speed);
/**
* Set the speed of left and right side steps.
*/
void set_camera_side_speed(Camera* camera, double speed);
#endif /* CAMERA_H */