X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FEntity.hpp;h=b140a08d95d7b21db850ef1966f841ffccf938f3;hb=3e7901a804ef85eea01adfb60274218748c0337b;hp=0117fa9cb0d0801deb53750c54b0b93c2d236cc1;hpb=da21395e4900bf283ece7364c67d9bad27dca279;p=blank.git diff --git a/src/world/Entity.hpp b/src/world/Entity.hpp index 0117fa9..b140a08 100644 --- a/src/world/Entity.hpp +++ b/src/world/Entity.hpp @@ -4,6 +4,7 @@ #include "Chunk.hpp" #include "EntityDerivative.hpp" #include "EntityState.hpp" +#include "Steering.hpp" #include "../geometry/primitive.hpp" #include "../model/Instance.hpp" @@ -32,6 +33,9 @@ public: Entity(const Entity &) noexcept; Entity &operator =(const Entity &) = delete; + Steering &GetSteering() noexcept { return steering; } + const Steering &GetSteering() const noexcept { return steering; } + bool HasController() const noexcept { return ctrl; } // entity takes over ownership of controller void SetController(EntityController *c) noexcept; @@ -91,7 +95,9 @@ 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; } + const glm::mat4 &Transform() const noexcept { return model_transform; } + /// get the entity's local up vector + const glm::vec4 &Up() const noexcept { return model_transform[1]; } /// 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 @@ -142,6 +148,7 @@ private: private: + Steering steering; EntityController *ctrl; Instance model;