X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fentity.hpp;h=5ef8fbedd420f5eb244abf0f6b84405be92ba9e5;hb=c877ddd21f402381d88a6bebdd5c7c0b4ac28ba9;hp=b739ae439bc753e56e0bafb0cbd4865539141271;hpb=b35ce3a6423c554b34b37362c5550bd705e63a1d;p=blank.git diff --git a/src/entity.hpp b/src/entity.hpp index b739ae4..5ef8fbe 100644 --- a/src/entity.hpp +++ b/src/entity.hpp @@ -1,40 +1,61 @@ #ifndef BLANK_ENTITY_HPP_ #define BLANK_ENTITY_HPP_ -#include "geometry.hpp" +#include "block.hpp" +#include "chunk.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 &); - 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 glm::tvec3 ChunkCoords() const { return chunk; } + 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 glm::tvec3 &chunk_offset) const; - Ray Aim(const glm::tvec3 &chunk_offset) 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; - glm::tvec3 chunk; + Block::Pos position; + Chunk::Pos chunk; + glm::quat angular_velocity; glm::mat4 rotation; };