]> git.localhorst.tv Git - blank.git/blobdiff - src/world/chunk.cpp
figure out depth and normal in box/box test
[blank.git] / src / world / chunk.cpp
index 2216617ec52aac4dc59b317329d2103da84d872a..7591266be5433ecb6b7a0e6c200e1eb3026a68e7 100644 (file)
@@ -5,6 +5,7 @@
 #include "Generator.hpp"
 
 #include <algorithm>
+#include <iostream>
 #include <limits>
 #include <queue>
 
@@ -486,7 +487,10 @@ bool Chunk::Intersection(
        const glm::mat4 &Mbox,
        const glm::mat4 &Mchunk
 ) const noexcept {
-       if (!blank::Intersection(box, Mbox, Bounds(), Mchunk)) {
+       float penetration;
+       glm::vec3 normal;
+
+       if (!blank::Intersection(box, Mbox, Bounds(), Mchunk, penetration, normal)) {
                return false;
        }
        for (int idx = 0, z = 0; z < depth; ++z) {