X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FEntity.hpp;fp=src%2Fworld%2FEntity.hpp;h=802ea90642db422063f33cd23c09f09cf8bd5bcd;hb=0d580658b896dfec07466c31ae4847455724ee95;hp=7c10395ce6c5a04025d57467984c55fc26f4db2c;hpb=465bd7f96fbae44067bd342649e52c9187853b39;p=blank.git diff --git a/src/world/Entity.hpp b/src/world/Entity.hpp index 7c10395..802ea90 100644 --- a/src/world/Entity.hpp +++ b/src/world/Entity.hpp @@ -86,8 +86,10 @@ public: 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 + /// 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 Chunk::Pos &chunk_offset) const noexcept; @@ -99,7 +101,7 @@ public: /// normalized velocity or heading if standing still const glm::vec3 &Heading() const noexcept { return heading; } - void SetState(const EntityState &s) noexcept { state = s; UpdateModel(); } + void SetState(const EntityState &s) noexcept { state = s; } const EntityState &GetState() const noexcept { return state; } void Ref() noexcept { ++ref_count; } @@ -116,9 +118,14 @@ public: } private: - void UpdateModel() noexcept; void UpdateTransforms() noexcept; void UpdateHeading() noexcept; + void UpdateModel(float dt) noexcept; +public: + // temporarily made public so AI can use it until it's smoothed out to be suitable for players, too + void OrientBody(float dt) noexcept; +private: + void OrientHead(float dt) noexcept; private: EntityController *ctrl;