X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fentity.hpp;h=5ef8fbedd420f5eb244abf0f6b84405be92ba9e5;hb=15ff5ed48855c6bd09bc8f5152f46065484c1e94;hp=77c7eb57d2e65f330599f752bd30494c4c440ca7;hpb=eca1fdcc8e34a4918418b2de122c6200aeb7ceaf;p=blank.git diff --git a/src/entity.hpp b/src/entity.hpp index 77c7eb5..5ef8fbe 100644 --- a/src/entity.hpp +++ b/src/entity.hpp @@ -3,18 +3,27 @@ #include "block.hpp" #include "chunk.hpp" -#include "geometry.hpp" +#include "model.hpp" #include +#include 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; };