X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FFPSController.hpp;h=a7b11a417eff960fb31a6504e12c592439a48b1f;hb=ad7cf72ed47c39640d5588ba53386e090289b4d1;hp=88dca64e01d8bbf8872c0f68d2c128a12550b0e7;hpb=b7d09e1e35ef90282c97509e0020b20db3c7ea9f;p=blank.git diff --git a/src/app/FPSController.hpp b/src/app/FPSController.hpp index 88dca64..a7b11a4 100644 --- a/src/app/FPSController.hpp +++ b/src/app/FPSController.hpp @@ -9,13 +9,22 @@ namespace blank { +/// Sets entity rotation and velocity according to stored velocity +/// and pitch/yaw components. +/// Rotation is applied in yaw,pitch order (YX). Velocity is relative +/// to yaw only (Y axis). class FPSController { public: explicit FPSController(Entity &) noexcept; + Entity &Controlled() noexcept { return entity; } + const Entity &Controlled() const noexcept { return entity; } + + /// get position and face direction of controlled entity Ray Aim() const noexcept { return entity.Aim(entity.ChunkCoords()); } + /// velocity, relative to heading (yaw only) const glm::vec3 &Velocity() const noexcept { return velocity; } void Velocity(const glm::vec3 &vel) noexcept { velocity = vel; }