]> git.localhorst.tv Git - blank.git/commitdiff
fix normal generated by chunk intersection test
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 12 Mar 2015 23:16:28 +0000 (00:16 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 12 Mar 2015 23:16:28 +0000 (00:16 +0100)
src/chunk.cpp

index 4cabcecf040e17784ac86b2e0d5c869949d63c34..f43f8fd524582525a08d0f915e1e7d9d02db752e 100644 (file)
@@ -104,7 +104,7 @@ bool Chunk::Intersection(
                *dist = closest_dist;
        }
        if (normal) {
-               *normal = closest_normal;
+               *normal = glm::vec3(BlockAt(closest_id).Transform() * glm::vec4(closest_normal, 0.0f));
        }
        return true;
 }