Adding a buggy FPS Camera with position and rotation
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user