]> git.localhorst.tv Git - blank.git/blobdiff - src/controller.cpp
make forward key actually go forward ^^
[blank.git] / src / controller.cpp
index 19adf1bf723cb150e6a482abb47817474a36b631..5d547b7eab8d3a39b725137425367fe9480d960d 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <glm/gtc/matrix_transform.hpp>
 #include <glm/gtx/euler_angles.hpp>
+#include <glm/gtx/rotate_vector.hpp>
 #include <glm/gtx/transform.hpp>
 
 
@@ -25,6 +26,11 @@ glm::mat4 FPSController::Transform() const {
 }
 
 
+void FPSController::OrientationVelocity(const glm::vec3 &vel) {
+       velocity = glm::rotateY(vel, yaw);
+}
+
+
 void FPSController::Update(int dt) {
        position += velocity * float(dt);
 }