]> git.localhorst.tv Git - blank.git/blobdiff - src/world/Entity.hpp
glm backwards compatibility
[blank.git] / src / world / Entity.hpp
index 0117fa9cb0d0801deb53750c54b0b93c2d236cc1..d5c3cb1822f94a80b53d8d20690f45bbc90b860c 100644 (file)
@@ -4,12 +4,13 @@
 #include "Chunk.hpp"
 #include "EntityDerivative.hpp"
 #include "EntityState.hpp"
+#include "Steering.hpp"
 #include "../geometry/primitive.hpp"
+#include "../graphics/glm.hpp"
 #include "../model/Instance.hpp"
 
 #include <cstdint>
 #include <string>
-#include <glm/glm.hpp>
 #include <glm/gtc/quaternion.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;