~ | Better camera managment

This commit is contained in:
TheRedShip
2025-01-09 11:48:32 +01:00
parent dbdd08f3ec
commit e474e451e6
11 changed files with 144 additions and 50 deletions

View File

@ -110,6 +110,18 @@ void Window::keyCallback(GLFWwindow *window, int key, int scancode, int action,
{
Window* win = static_cast<Window*>(glfwGetWindowUserPointer(window));
(void) win; (void) key; (void) scancode; (void) action; (void) mods;
if (key == 67 && action == GLFW_PRESS)
{
glm::vec3 pos = win->_scene->getCamera()->getPosition();
glm::vec2 dir = win->_scene->getCamera()->getDirection();
glm::vec2 dov = win->_scene->getCamera()->getDOV();
std::cout << "\nCAM\t" << pos.x << " " << pos.y << " " << pos.z << "\t"
<< dir.x << " " << dir.y << " " << "\t"
<< dov.x << " " << dov.y << " " << "\t"
<< std::endl;
}
}
void Window::display()