From 809c4766ba13e85546a747fe5e0dbd82e1e6d549 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 11 Aug 2018 06:10:33 +0500 Subject: Correct face culling for rotated blocks --- src/AssetManager.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/AssetManager.hpp') diff --git a/src/AssetManager.hpp b/src/AssetManager.hpp index 28cafb0..1996c9e 100644 --- a/src/AssetManager.hpp +++ b/src/AssetManager.hpp @@ -24,6 +24,16 @@ enum FaceDirection { none, }; +static const Vector FaceDirectionVector[] = { + Vector(0,-1,0), + Vector(0,1,0), + Vector(0,0,-1), + Vector(0,0,1), + Vector(-1,0,0), + Vector(1,0,0), + Vector(0,0,0) +}; + struct ParsedFace { FaceDirection visibility; glm::mat4 transform; @@ -36,6 +46,7 @@ struct BlockFaces { glm::mat4 transform; std::vector faces; bool isBlock; + FaceDirection direction; }; struct BlockModel { -- cgit v1.2.3