]> git.localhorst.tv Git - blank.git/blobdiff - src/entity.hpp
random walk test controller
[blank.git] / src / entity.hpp
index 59a3388757e0fc25132259faaddcb5931de17dd7..5ef8fbedd420f5eb244abf0f6b84405be92ba9e5 100644 (file)
@@ -1,42 +1,63 @@
 #ifndef BLANK_ENTITY_HPP_
 #define BLANK_ENTITY_HPP_
 
-#include "geometry.hpp"
+#include "block.hpp"
+#include "chunk.hpp"
+#include "model.hpp"
 
 #include <glm/glm.hpp>
+#include <glm/gtc/quaternion.hpp>
 
 
 namespace blank {
 
+class Ray;
+class Shape;
+
 class Entity {
 
 public:
        Entity();
 
+       bool HasShape() const { return shape; }
+       const Shape *GetShape() const { return shape; }
+       void SetShape(const Shape *, const glm::vec3 &color);
+       void SetShapeless();
+
        const glm::vec3 &Velocity() const { return velocity; }
        void Velocity(const glm::vec3 &);
 
-       const glm::vec3 &Position() const { return position; }
-       void Position(const glm::vec3 &);
+       const Block::Pos &Position() const { return position; }
+       void Position(const Block::Pos &);
        void Move(const glm::vec3 &delta);
 
+       const Chunk::Pos ChunkCoords() const { return chunk; }
+
+       const glm::quat &AngularVelocity() const { return angular_velocity; }
+       void AngularVelocity(const glm::quat &);
+
        const glm::mat4 &Rotation() const { return rotation; }
        void Rotation(const glm::mat4 &);
+       void Rotate(const glm::quat &delta);
 
-       const glm::mat4 &Transform() const;
-       Ray Aim() const;
+       glm::mat4 Transform(const Chunk::Pos &chunk_offset) const;
+       Ray Aim(const Chunk::Pos &chunk_offset) const;
 
        void Update(int dt);
 
+       void Draw();
+
 private:
+       const Shape *shape;
+       Model model;
+
        glm::vec3 velocity;
-       glm::vec3 position;
+       Block::Pos position;
+       Chunk::Pos chunk;
 
+       glm::quat angular_velocity;
        glm::mat4 rotation;
 
-       mutable glm::mat4 transform;
-       mutable bool dirty;
-
 };
 
 }