Added pane rotation profile
This commit is contained in:
parent
788234ab94
commit
81704140a7
@ -11,5 +11,5 @@
|
|||||||
"hitbox": [0.0, 0.0, 0.0, 1.0, 1.0, 0.2],
|
"hitbox": [0.0, 0.0, 0.0, 1.0, 1.0, 0.2],
|
||||||
"light-passing": true,
|
"light-passing": true,
|
||||||
"sky-light-passing": true,
|
"sky-light-passing": true,
|
||||||
"rotation": "pipe"
|
"rotation": "pane"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,6 +59,8 @@ Block* ContentLoader::loadBlock(string name, path file) {
|
|||||||
def->rotatable = profile != "none";
|
def->rotatable = profile != "none";
|
||||||
if (profile == "pipe") {
|
if (profile == "pipe") {
|
||||||
def->rotations = BlockRotProfile::PIPE;
|
def->rotations = BlockRotProfile::PIPE;
|
||||||
|
} else if (profile == "pane") {
|
||||||
|
def->rotations = BlockRotProfile::PANE;
|
||||||
} else if (profile != "none") {
|
} else if (profile != "none") {
|
||||||
cerr << "unknown rotation profile " << profile << endl;
|
cerr << "unknown rotation profile " << profile << endl;
|
||||||
def->rotatable = false;
|
def->rotatable = false;
|
||||||
|
|||||||
@ -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, -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+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 */
|
/* Fastest solid shaded blocks render method */
|
||||||
|
|||||||
@ -21,6 +21,17 @@ const BlockRotProfile BlockRotProfile::PIPE {{
|
|||||||
{{1, 0, 0}, {0, 0, 1}, {0, -1, 0}, {0, 0, -1}, {0, 1, 0}},
|
{{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)
|
Block::Block(std::string name)
|
||||||
: name(name),
|
: name(name),
|
||||||
textureFaces {"notfound","notfound","notfound",
|
textureFaces {"notfound","notfound","notfound",
|
||||||
|
|||||||
@ -31,10 +31,10 @@ struct BlockRotProfile {
|
|||||||
static const int MAX_COUNT = 16;
|
static const int MAX_COUNT = 16;
|
||||||
CoordSystem variants[MAX_COUNT];
|
CoordSystem variants[MAX_COUNT];
|
||||||
|
|
||||||
/* Wood logs, pillars, pipes
|
/* Wood logs, pillars, pipes */
|
||||||
3 orientations supported
|
|
||||||
*/
|
|
||||||
static const BlockRotProfile PIPE;
|
static const BlockRotProfile PIPE;
|
||||||
|
/* Doors, signs and other panes */
|
||||||
|
static const BlockRotProfile PANE;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class BlockModel {
|
enum class BlockModel {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user