1 #include "FPSController.hpp"
3 #include <glm/gtx/euler_angles.hpp>
4 #include <glm/gtx/rotate_vector.hpp>
9 FPSController::FPSController(Entity &entity) noexcept
17 void FPSController::Pitch(float p) noexcept {
21 } else if (pitch < -PI / 2) {
26 void FPSController::RotatePitch(float delta) noexcept {
30 void FPSController::Yaw(float y) noexcept {
34 } else if (yaw < -PI) {
39 void FPSController::RotateYaw(float delta) noexcept {
44 void FPSController::Update(int dt) noexcept {
45 entity.Orientation(glm::quat(glm::vec3(pitch, yaw, 0.0f)));
46 entity.Velocity(glm::rotateY(velocity, yaw));