]> git.localhorst.tv Git - blank.git/blob - src/entity.hpp
b739ae439bc753e56e0bafb0cbd4865539141271
[blank.git] / src / entity.hpp
1 #ifndef BLANK_ENTITY_HPP_
2 #define BLANK_ENTITY_HPP_
3
4 #include "geometry.hpp"
5
6 #include <glm/glm.hpp>
7
8
9 namespace blank {
10
11 class Entity {
12
13 public:
14         Entity();
15
16         const glm::vec3 &Velocity() const { return velocity; }
17         void Velocity(const glm::vec3 &);
18
19         const glm::vec3 &Position() const { return position; }
20         void Position(const glm::vec3 &);
21         void Move(const glm::vec3 &delta);
22
23         const glm::tvec3<int> ChunkCoords() const { return chunk; }
24
25         const glm::mat4 &Rotation() const { return rotation; }
26         void Rotation(const glm::mat4 &);
27
28         glm::mat4 Transform(const glm::tvec3<int> &chunk_offset) const;
29         Ray Aim(const glm::tvec3<int> &chunk_offset) const;
30
31         void Update(int dt);
32
33 private:
34         glm::vec3 velocity;
35         glm::vec3 position;
36         glm::tvec3<int> chunk;
37
38         glm::mat4 rotation;
39
40 };
41
42 }
43
44 #endif