]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/ui.cpp
brought some order to the whole controller thing
[blank.git] / src / ui / ui.cpp
index 1af9e8722f75cbc60c503b7882b6c187abde12a5..dd113ca2b620d8fd763934459e9e4b1f088c15ce 100644 (file)
@@ -52,9 +52,8 @@ void PlayerController::SetMovement(const glm::vec3 &m) noexcept {
        Invalidate();
 }
 
-glm::vec3 PlayerController::ControlForce(const EntityState &s) const {
-       glm::vec3 target(rotateY(move_dir * player.GetEntity().MaxVelocity(), s.yaw) - s.velocity);
-       return target * player.GetEntity().MaxControlForce();
+glm::vec3 PlayerController::ControlForce(const Entity &e, const EntityState &s) const {
+       return TargetVelocity(rotateY(move_dir * e.MaxVelocity(), s.yaw), s, 5.0f);
 }
 
 void PlayerController::TurnHead(float dp, float dy) noexcept {