tried to add assimp (spoilers, it did not go well, so hey! now we have separate fiels now.)
Some checks are pending
Build C++ Project with Fedora Container and Create Release / build (push) Waiting to run
Some checks are pending
Build C++ Project with Fedora Container and Create Release / build (push) Waiting to run
This commit is contained in:
34
src/Camera.h
Normal file
34
src/Camera.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
class Camera {
|
||||
public:
|
||||
glm::vec3 position = glm::vec3(0.0f, 0.0f, 3.0f);
|
||||
glm::vec3 front = glm::vec3(0.0f, 0.0f, -1.0f);
|
||||
glm::vec3 up = glm::vec3(0.0f, 1.0f, 0.0f);
|
||||
glm::vec3 velocity = glm::vec3(0.0f);
|
||||
float yaw = -90.0f;
|
||||
float pitch = 0.0f;
|
||||
float speed = CAMERA_SPEED;
|
||||
float lastX = 400.0f, lastY = 300.0f;
|
||||
bool firstMouse = true;
|
||||
|
||||
void processMouse(double xpos, double ypos);
|
||||
void processKeyboard(float deltaTime, GLFWwindow* window);
|
||||
glm::mat4 getViewMatrix() const;
|
||||
};
|
||||
|
||||
class ViewportController {
|
||||
private:
|
||||
bool viewportFocused = false;
|
||||
bool manualUnfocus = false;
|
||||
|
||||
public:
|
||||
void updateFocusFromImGui(bool windowFocused);
|
||||
void setFocused(bool focused);
|
||||
bool isViewportFocused() const;
|
||||
void clearManualUnfocus();
|
||||
void update(GLFWwindow* window, bool& cursorLocked);
|
||||
};
|
||||
Reference in New Issue
Block a user