- glm::mat4 Transform(const glm::ivec3 &reference) const noexcept {
- return state.Transform(reference);
- }
- Ray Aim(const Chunk::Pos &chunk_offset) const noexcept;
+ /// orientation of head within local coordinate system, in radians
+ float Pitch() const noexcept { return state.pitch; }
+ float Yaw() const noexcept { return state.yaw; }
+ void TurnHead(float delta_pitch, float delta_yaw) noexcept;
+ void SetHead(float pitch, float yaw) noexcept;
+
+ /// get a transform for this entity's coordinate space
+ const glm::mat4 Transform() const noexcept { return model_transform; }
+ /// get a transform for this entity's coordinate space relative to reference chunk
+ glm::mat4 Transform(const glm::ivec3 &reference) const noexcept;
+ /// get a transform for this entity's view space relative to reference chunk
+ glm::mat4 ViewTransform(const glm::ivec3 &reference) const noexcept;
+ /// get a ray in entity's face direction originating from center of vision
+ Ray Aim(const ExactLocation::Coarse &chunk_offset) const noexcept;
+
+ /// true if this entity's position will change (significantly) the next update
+ bool Moving() const noexcept { return speed > 0.0f; }
+ /// magnitude of velocity
+ float Speed() const noexcept { return speed; }
+ /// normalized velocity or heading if standing still
+ const glm::vec3 &Heading() const noexcept { return heading; }