X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fentity.hpp;fp=src%2Fentity.hpp;h=423cb88d3a18bb5877b50d5d18e518b4089bc7c9;hb=9eb7fb38870c6324580683752d49d62b7a431bce;hp=77c7eb57d2e65f330599f752bd30494c4c440ca7;hpb=5a8964bc8bc4108febe8eca3b03cb901824ac90b;p=blank.git diff --git a/src/entity.hpp b/src/entity.hpp index 77c7eb5..423cb88 100644 --- a/src/entity.hpp +++ b/src/entity.hpp @@ -4,17 +4,27 @@ #include "block.hpp" #include "chunk.hpp" #include "geometry.hpp" +#include "model.hpp" +#include "shape.hpp" #include +#include namespace blank { +class Shape; + class Entity { public: Entity(); + bool HasShape() const { return shape; } + const Shape *GetShape() const { return shape; } + void SetShape(Shape *, const glm::vec3 &color); + void SetShapeless(); + const glm::vec3 &Velocity() const { return velocity; } void Velocity(const glm::vec3 &); @@ -24,19 +34,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: + Shape *shape; + Model model; + glm::vec3 velocity; Block::Pos position; Chunk::Pos chunk; + glm::quat angular_velocity; glm::mat4 rotation; };