Adding a buggy FPS Camera with position and rotation

This commit is contained in:
2019-12-09 05:46:30 +02:00
parent ad56096eb3
commit b51c63ea0c
9 changed files with 255 additions and 106 deletions
+48
View File
@@ -0,0 +1,48 @@
#ifndef __CAMERA_HEADER__
#define __CAMERA_HEADER__
#include "geometry.h"
class Camera {
private:
Vec3f position;
Vec3f rotation;
Vec3f up;
Vec3f right;
Vec3f forward;
float fov;
float near_plane;
float far_plane;
float horizontal_camera_speed;
float vertical_camera_speed;
float vertical_camera_clamp_up;
float vertical_camera_clamp_down;
public:
Camera();
void SetPosition(Vec3f pos);
void SetRotation(Vec3f rot);
void Move(Vec3f move_vec);
void Rotate(Vec3f rot_vec);
void SetFOV(int angle);
void SetNearPlane(float near_val);
void SetFarPlane(float far_val);
void SetVerticalRotSpeed(float speed);
void SetHorizontalRotSpeed(float speed);
void SetClampRotUp(float angle);
void SetClampRotDown(float angle);
Vec3f GetForward();
void rotate_camera_right();
void rotate_camera_left();
void rotate_camera_up();
void rotate_camera_down();
void move_camera_left();
void move_camera_right();
void move_camera_forward();
void move_camera_backward();
void ApplyChanges();
Matrix GetModelViewMatrix();
Matrix GetProjectionMatrix();
};
#endif