]> git.localhorst.tv Git - blank.git/blobdiff - src/entity.hpp
random walk test controller
[blank.git] / src / entity.hpp
index 77c7eb57d2e65f330599f752bd30494c4c440ca7..5ef8fbedd420f5eb244abf0f6b84405be92ba9e5 100644 (file)
@@ -3,18 +3,27 @@
 
 #include "block.hpp"
 #include "chunk.hpp"
-#include "geometry.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 &);
 
@@ -24,19 +33,29 @@ public:
 
        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);
 
        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;
        Block::Pos position;
        Chunk::Pos chunk;
 
+       glm::quat angular_velocity;
        glm::mat4 rotation;
 
 };