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