8 const bool isPressed = glfwGetKey(window,
static_cast<int>(key)) == GLFW_PRESS;
9 const bool wasPressed = keyStates.at(key);
11 keyStates.at(key) = isPressed;
13 return isPressed && !wasPressed;
29 glm::vec3 moveDir{0.F};
30 static constexpr glm::vec3 upDir{0.F, -1.F, 0.F};
32 const glm::vec3 forwardDir{std::sin(yaw), 0.F, std::cos(yaw)};
33 const glm::vec3 rightDir{forwardDir.z, 0.F, -forwardDir.x};
34 const std::array<KeyAction, 10> moveActions = {{
47 processKeyActions(window, moveActions.begin(), moveActions.end());
49 if (
const float lengthRotate = length2(rotate); lengthRotate >
EPSILON) {
52 if (
const float lengthMove = length2(moveDir); lengthMove >
EPSILON) {