]> git.localhorst.tv Git - blank.git/blobdiff - src/world/WorldCollision.hpp
check for entities under crosshair
[blank.git] / src / world / WorldCollision.hpp
index eb2e5e2871a334bfe02e1bd0be24a5c48572af98..ebf01c17cd0362bfda3f1ba15f674367b8205bc2 100644 (file)
@@ -1,13 +1,14 @@
 #ifndef BLANK_WORLD_WORLDCOLLISION_HPP_
 #define BLANK_WORLD_WORLDCOLLISION_HPP_
 
+#include "BlockType.hpp"
+#include "Chunk.hpp"
+
 #include <glm/glm.hpp>
 
 
 namespace blank {
 
-class Chunk;
-
 struct WorldCollision {
 
        const Chunk *chunk;
@@ -19,6 +20,10 @@ struct WorldCollision {
        WorldCollision(const Chunk *c, int b, float d, const glm::vec3 &n)
        : chunk(c), block(b), depth(d), normal(n) { }
 
+       bool Blocks() const noexcept { return chunk->Type(block).collide_block; }
+
+       glm::vec3 BlockCoords() const noexcept { return Chunk::ToCoords(block); }
+
 };
 
 }