1 #ifndef BLANK_WORLD_ENTITY_HPP_
2 #define BLANK_WORLD_ENTITY_HPP_
6 #include "../model/geometry.hpp"
7 #include "../model/Model.hpp"
10 #include <glm/glm.hpp>
11 #include <glm/gtc/quaternion.hpp>
23 bool HasShape() const noexcept { return shape; }
24 const Shape *GetShape() const noexcept { return shape; }
25 void SetShape(const Shape *, const glm::vec3 &color);
26 void SetShapeless() noexcept;
28 const std::string &Name() const noexcept { return name; }
29 void Name(const std::string &n) { name = n; }
31 const AABB &Bounds() const noexcept { return bounds; }
32 void Bounds(const AABB &b) noexcept { bounds = b; }
34 bool WorldCollidable() const noexcept { return world_collision; }
35 void WorldCollidable(bool b) noexcept { world_collision = b; }
37 const glm::vec3 &Velocity() const noexcept { return velocity; }
38 void Velocity(const glm::vec3 &) noexcept;
40 const Block::Pos &Position() const noexcept { return position; }
41 void Position(const Block::Pos &) noexcept;
42 void Move(const glm::vec3 &delta) noexcept;
44 const Chunk::Pos ChunkCoords() const noexcept { return chunk; }
46 const glm::quat &AngularVelocity() const noexcept { return angular_velocity; }
47 void AngularVelocity(const glm::quat &) noexcept;
49 const glm::mat4 &Rotation() const noexcept { return rotation; }
50 void Rotation(const glm::mat4 &) noexcept;
51 void Rotate(const glm::quat &delta) noexcept;
53 glm::mat4 Transform(const Chunk::Pos &chunk_offset) const noexcept;
54 Ray Aim(const Chunk::Pos &chunk_offset) const noexcept;
56 void Update(int dt) noexcept;
72 glm::quat angular_velocity;