]> git.localhorst.tv Git - blank.git/blobdiff - src/world/chunk.cpp
fix comment handling in TokenStreamReader
[blank.git] / src / world / chunk.cpp
index fb4375599226226d3e80ddcf670935a77d78e3d7..1d120bb2ebe8d2475a4be2ac1bc4799755b8d25d 100644 (file)
@@ -460,7 +460,7 @@ bool Chunk::Intersection(
        const glm::vec3 entity_coords(Mentity[3] - Mchunk[3]);
        const float ec_radius = entity.Radius() + Radius();
 
-       if (distance_squared(entity_coords, Center()) > ec_radius * ec_radius) {
+       if (distance2(entity_coords, Center()) > ec_radius * ec_radius) {
                return false;
        }
 
@@ -779,6 +779,7 @@ void ChunkRenderer::Render(Viewport &viewport) {
 
        for (int i = 0; i < index.TotalChunks(); ++i) {
                if (!index[i]) continue;
+               // TODO: optimize chunk culling, shoudn't be that hard
                glm::mat4 m(index[i]->Transform(index.Base()));
                glm::mat4 mvp(chunk_prog.GetVP() * m);
                if (!CullTest(Chunk::Bounds(), mvp)) {