]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/ui.cpp
use eye transform for client rendering
[blank.git] / src / ui / ui.cpp
index 96386195e57803c4aa8fcd498072caa229df768f..43cdb53613ec2660603204128f9fffc91cf24839 100644 (file)
@@ -83,9 +83,10 @@ void PlayerController::Invalidate() noexcept {
 }
 
 void PlayerController::UpdatePlayer() noexcept {
-       constexpr float max_vel = 0.005f;
+       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();