//
// Created by sebastian on 02.08.26.
//

#include "CameraController.h"

#include <iostream>
#include <ostream>

#include "GLFW/glfw3.h"
#include "glm/vec3.hpp"
#include "renderer/entities/Camera.h"

void engine::CameraController::update(const Keyboard &keyboard, Camera &camera, float deltaTime) {
    if (!m_stack.isActive(*m_gameContext.get())) return;


    if (keyboard.isKeyDown(GLFW_KEY_W)) camera.moveRelative(glm::vec3(0.0f, 0.0f, 1.0f), 10.0f, deltaTime);
    if (keyboard.isKeyDown(GLFW_KEY_S)) camera.moveRelative(glm::vec3(0.0f, 0.0f, -1.0f), 10.0f, deltaTime);
    if (keyboard.isKeyDown(GLFW_KEY_A)) camera.moveRelative(glm::vec3(-1.0f, 0.0f, 0.0f), 10.0f, deltaTime);
    if (keyboard.isKeyDown(GLFW_KEY_D)) camera.moveRelative(glm::vec3(1.0f, 0.0f, 0.0f), 10.0f, deltaTime);
    if (keyboard.isKeyDown(GLFW_KEY_SPACE)) camera.moveRelative(glm::vec3(0.0f, 1.0f, 0.0f), 10.0f, deltaTime);
}
