- /// direction is rotation axis, magnitude is speed in rad/ms
- const glm::vec3 &AngularVelocity() const noexcept { return angular_velocity; }
- void AngularVelocity(const glm::vec3 &v) noexcept { angular_velocity = v; }
-
- const glm::quat &Orientation() const noexcept { return model.Orientation(); }
- void Orientation(const glm::quat &o) noexcept { model.Orientation(o); }
- void Rotate(const glm::quat &delta) noexcept;
-
- glm::mat4 ChunkTransform(const Chunk::Pos &chunk_offset) const noexcept;
- glm::mat4 Transform(const Chunk::Pos &chunk_offset) const noexcept;
+ /// orientation of local coordinate system
+ const glm::quat &Orientation() const noexcept { return state.orient; }
+ void Orientation(const glm::quat &o) noexcept { state.orient = o; }
+
+ /// 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
+ glm::mat4 Transform(const glm::ivec3 &reference) const noexcept;
+ /// get a transform for this entity's view space
+ glm::mat4 ViewTransform(const glm::ivec3 &reference) const noexcept;
+ /// get a ray in entity's face direction originating from center of vision