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