#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();
+ Entity() noexcept;
+
+ bool HasShape() const noexcept { return shape; }
+ const Shape *GetShape() const noexcept { return shape; }
+ void SetShape(const Shape *, const glm::vec3 &color);
+ void SetShapeless() noexcept;
+
+ const glm::vec3 &Velocity() const noexcept { return velocity; }
+ void Velocity(const glm::vec3 &) noexcept;
- const glm::vec3 &Velocity() const { return velocity; }
- void Velocity(const glm::vec3 &);
+ const Block::Pos &Position() const noexcept { return position; }
+ void Position(const Block::Pos &) noexcept;
+ void Move(const glm::vec3 &delta) noexcept;
- const glm::vec3 &Position() const { return position; }
- void Position(const glm::vec3 &);
- void Move(const glm::vec3 &delta);
+ const Chunk::Pos ChunkCoords() const noexcept { return chunk; }
- const glm::tvec3<int> ChunkCoords() const { return chunk; }
+ const glm::quat &AngularVelocity() const noexcept { return angular_velocity; }
+ void AngularVelocity(const glm::quat &) noexcept;
- const glm::mat4 &Rotation() const { return rotation; }
- void Rotation(const glm::mat4 &);
+ const glm::mat4 &Rotation() const noexcept { return rotation; }
+ void Rotation(const glm::mat4 &) noexcept;
+ void Rotate(const glm::quat &delta) noexcept;
- glm::mat4 Transform(const glm::tvec3<int> &chunk_offset) const;
- Ray Aim(const glm::tvec3<int> &chunk_offset) const;
+ glm::mat4 Transform(const Chunk::Pos &chunk_offset) const noexcept;
+ Ray Aim(const Chunk::Pos &chunk_offset) const noexcept;
- void Update(int dt);
+ void Update(int dt) noexcept;
+
+ void Draw() noexcept;
private:
+ const Shape *shape;
+ Model model;
+
glm::vec3 velocity;
- glm::vec3 position;
- glm::tvec3<int> chunk;
+ Block::Pos position;
+ Chunk::Pos chunk;
+ glm::quat angular_velocity;
glm::mat4 rotation;
};