]> git.localhorst.tv Git - blank.git/blob - src/world/BlockGravity.hpp
glm backwards compatibility
[blank.git] / src / world / BlockGravity.hpp
1 #ifndef BLANK_WORLD_BLOCKGRAVITY_HPP_
2 #define BLANK_WORLD_BLOCKGRAVITY_HPP_
3
4 #include "../graphics/glm.hpp"
5
6 #include <memory>
7
8
9 namespace blank {
10
11 class TokenStreamReader;
12
13 struct BlockGravity {
14
15         virtual ~BlockGravity();
16
17         /// get gravitational force for a unit mass at relative position diff
18         /// diff is target - block, i.e. pointing from block towards the target
19         /// orientation of the block in question is given by M
20         /// return value should be world absolute
21         virtual glm::vec3 GetGravity(const glm::vec3 &diff, const glm::mat4 &M) const noexcept = 0;
22
23         static std::unique_ptr<BlockGravity> Read(TokenStreamReader &in);
24
25 };
26
27 }
28
29 #endif