]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/PlayerController.hpp
treat head pitch and yaw as entity state
[blank.git] / src / ui / PlayerController.hpp
index b29795b7313cf9cb5b8d2308e72cfcfa0f03a182..b9d3b2bd6cf6854f53cf5586b07fa49dcc72cc12 100644 (file)
@@ -17,6 +17,8 @@ class PlayerController {
 public:
        PlayerController(World &, Player &);
 
+       World &GetWorld() noexcept { return world; }
+       const World &GetWorld() const noexcept { return world; }
        Player &GetPlayer() noexcept { return player; }
        const Player &GetPlayer() const noexcept { return player; }
 
@@ -33,9 +35,9 @@ public:
        void TurnHead(float pitch, float yaw) noexcept;
 
        /// get player pitch in radians, normalized to [-PI/2,PI/2]
-       float GetPitch() const noexcept { return pitch; }
+       float GetPitch() const noexcept;
        /// get player yaw in radians, normalized to [-PI,PI]
-       float GetYaw() const noexcept { return yaw; }
+       float GetYaw() const noexcept;
 
        /// start doing primary action
        /// what exactly this means depends on the active item
@@ -60,8 +62,6 @@ private:
        World &world;
        Player &player;
        glm::vec3 move_dir;
-       float pitch;
-       float yaw;
        bool dirty;
 
        WorldCollision aim_world;