diff --git a/res/content/base/blocks/pane.json b/res/content/base/blocks/pane.json index d2379085..f82f9e2d 100644 --- a/res/content/base/blocks/pane.json +++ b/res/content/base/blocks/pane.json @@ -11,5 +11,5 @@ "hitbox": [0.0, 0.0, 0.0, 1.0, 1.0, 0.2], "light-passing": true, "sky-light-passing": true, - "rotation": "pipe" + "rotation": "pane" } diff --git a/src/content/ContentLoader.cpp b/src/content/ContentLoader.cpp index 01db3ecd..39d0d091 100644 --- a/src/content/ContentLoader.cpp +++ b/src/content/ContentLoader.cpp @@ -59,6 +59,8 @@ Block* ContentLoader::loadBlock(string name, path file) { def->rotatable = profile != "none"; if (profile == "pipe") { def->rotations = BlockRotProfile::PIPE; + } else if (profile == "pane") { + def->rotations = BlockRotProfile::PANE; } else if (profile != "none") { cerr << "unknown rotation profile " << profile << endl; def->rotatable = false; diff --git a/src/graphics/BlocksRenderer.cpp b/src/graphics/BlocksRenderer.cpp index 32ed4e32..0721c88f 100644 --- a/src/graphics/BlocksRenderer.cpp +++ b/src/graphics/BlocksRenderer.cpp @@ -262,7 +262,7 @@ void BlocksRenderer::blockCubeShaded(const ivec3& icoord, face(coord+X, -X, -Z, -Y, -X-Y+loff, local, size.x, size.z, 0.0f, texfaces[2]); face(coord+X, -Z, Y, X, X-X+loff, local, size.z, size.y, 0.0f, texfaces[1]); - face(coord+Y, -Z, -Y, -X, -X-Y-Z+loff, local, size.z, size.y, 0.0f, texfaces[0]); + face(coord+Y, -Z, -Y, -X, -X-Y+loff, local, size.z, size.y, 0.0f, texfaces[0]); } /* Fastest solid shaded blocks render method */ diff --git a/src/voxels/Block.cpp b/src/voxels/Block.cpp index d794cfbc..f8c6594f 100644 --- a/src/voxels/Block.cpp +++ b/src/voxels/Block.cpp @@ -21,6 +21,17 @@ const BlockRotProfile BlockRotProfile::PIPE {{ {{1, 0, 0}, {0, 0, 1}, {0, -1, 0}, {0, 0, -1}, {0, 1, 0}}, }}; +const BlockRotProfile BlockRotProfile::PANE {{ + // North + {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {0, 0, 0}, {0, 0, 0}}, + // East + {{0, 0, -1}, {0, 1, 0}, {1, 0, 0}, {1, 0, 0}, {0, 0, 1}}, + // South + {{-1, 0, 0}, {0, 1, 0}, {0, 0, -1}, {1, 0, -1}, {1, 0, 1}}, + // West + {{0, 0, 1}, {0, 1, 0}, {-1, 0, 0}, {0, 0, -1}, {1, 0, 0}}, +}}; + Block::Block(std::string name) : name(name), textureFaces {"notfound","notfound","notfound", diff --git a/src/voxels/Block.h b/src/voxels/Block.h index 8aa90ed1..c250b89e 100644 --- a/src/voxels/Block.h +++ b/src/voxels/Block.h @@ -31,10 +31,10 @@ struct BlockRotProfile { static const int MAX_COUNT = 16; CoordSystem variants[MAX_COUNT]; - /* Wood logs, pillars, pipes - 3 orientations supported - */ + /* Wood logs, pillars, pipes */ static const BlockRotProfile PIPE; + /* Doors, signs and other panes */ + static const BlockRotProfile PANE; }; enum class BlockModel {