added project structure
This commit is contained in:
21
include/camera/Camera.hpp
Normal file
21
include/camera/Camera.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "glm/glm.hpp"
|
||||
#include "glm/gtc/matrix_transform.hpp"
|
||||
|
||||
class Camera {
|
||||
protected:
|
||||
glm::vec3 position;
|
||||
glm::mat4 projection;
|
||||
glm::mat4 view;
|
||||
glm::mat4 viewProj;
|
||||
|
||||
public:
|
||||
Camera(float fov, float width, float height);
|
||||
virtual ~Camera() = default;
|
||||
|
||||
glm::mat4 getViewProj();
|
||||
|
||||
virtual void update();
|
||||
virtual void translate(glm::vec3 v);
|
||||
};
|
||||
20
include/camera/FPS_Camera.hpp
Normal file
20
include/camera/FPS_Camera.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "Camera.hpp"
|
||||
|
||||
class FPSCamera : public Camera {
|
||||
protected:
|
||||
float yaw; // rotation y-axis
|
||||
float pitch; // rotating x-axis
|
||||
glm::vec3 lookAt;
|
||||
const float mouseSensitivity = 0.3f;
|
||||
glm::vec3 up;
|
||||
|
||||
public:
|
||||
FPSCamera(float fov, float width, float height);
|
||||
|
||||
void onMouseMoved(float xRel, float yRel);
|
||||
void update() override;
|
||||
void moveFront(float amount);
|
||||
void moveSideways(float amount);
|
||||
};
|
||||
Reference in New Issue
Block a user