1 #include "controller.hpp"
3 #include <glm/gtc/matrix_transform.hpp>
4 #include <glm/gtx/euler_angles.hpp>
5 #include <glm/gtx/rotate_vector.hpp>
6 #include <glm/gtx/transform.hpp>
11 FPSController::FPSController()
20 glm::mat4 FPSController::Transform() const {
21 return glm::translate(position) * glm::eulerAngleYX(yaw, pitch);
25 void FPSController::OrientationVelocity(const glm::vec3 &vel) {
26 velocity = glm::rotateY(vel, yaw);
30 void FPSController::Update(int dt) {
31 position += velocity * float(dt);