]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/ui.cpp
apply pitch to head instead of body
[blank.git] / src / ui / ui.cpp
index 5b0eec8b1dac47bb7b1798e51dbfb4d814892893..43cdb53613ec2660603204128f9fffc91cf24839 100644 (file)
@@ -85,7 +85,8 @@ void PlayerController::Invalidate() noexcept {
 void PlayerController::UpdatePlayer() noexcept {
        constexpr float max_vel = 5.0f; // in m/s
        if (dirty) {
-               player.GetEntity().Orientation(glm::quat(glm::vec3(pitch, yaw, 0.0f)));
+               player.GetEntity().Orientation(glm::quat(glm::vec3(0.0f, yaw, 0.0f)));
+               player.GetEntity().GetModel().EyesState().orientation = glm::quat(glm::vec3(pitch, 0.0f, 0.0f));
                player.GetEntity().TargetVelocity(glm::rotateY(move_dir * max_vel, yaw));
 
                Ray aim = player.Aim();