X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp.cpp;h=70c45d478c7284ffdf42866ed6900049c082771d;hb=4d0ef1687987a0801469c7262f81efd36636605a;hp=b398e9c20e4e032e7c6b9d59df18a39746e7239a;hpb=ac8765b510707d77cac9620778f40ddf3a4ad2a2;p=blank.git diff --git a/src/app.cpp b/src/app.cpp index b398e9c..70c45d4 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -1,5 +1,7 @@ #include "app.hpp" +#include "geometry.hpp" + #include #include @@ -234,6 +236,17 @@ void Application::Update(int dt) { cam.OrientationVelocity(vel); cam.Update(dt); + + Ray aim = cam.Aim(); + int blkid; + float dist; + if (chunk.Intersection(aim, glm::mat4(1.0f), &blkid, &dist)) { + glm::vec3 pos = Chunk::ToCoords(blkid); + std::cout << "pointing at: <" << pos.x << ", " << pos.y << ", " << pos.z << ">, " + "distance: " << dist << std::endl; + } else { + std::cout << "pointing at: nothing" << std::endl; + } } void Application::Render() {