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