X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FBlockGravity.hpp;fp=src%2Fworld%2FBlockGravity.hpp;h=6a17b61e6dee46b93f2cdd268a91380dd3196e00;hb=ed3bdc028edc0ecb5835d1c0bf18dbc59b342daf;hp=0000000000000000000000000000000000000000;hpb=73d4dd2d78eda1e2f8889d1913a97a60cec86876;p=blank.git diff --git a/src/world/BlockGravity.hpp b/src/world/BlockGravity.hpp new file mode 100644 index 0000000..6a17b61 --- /dev/null +++ b/src/world/BlockGravity.hpp @@ -0,0 +1,28 @@ +#ifndef BLANK_WORLD_BLOCKGRAVITY_HPP_ +#define BLANK_WORLD_BLOCKGRAVITY_HPP_ + +#include +#include + + +namespace blank { + +class TokenStreamReader; + +struct BlockGravity { + + virtual ~BlockGravity(); + + /// get gravitational force for a unit mass at relative position diff + /// diff is target - block, i.e. pointing from block towards the target + /// orientation of the block in question is given by M + /// return value should be world absolute + virtual glm::vec3 GetGravity(const glm::vec3 &diff, const glm::mat4 &M) const noexcept = 0; + + static std::unique_ptr Read(TokenStreamReader &in); + +}; + +} + +#endif