mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
Block rotation profiles
This commit is contained in:
parent
9ded9b63f8
commit
8bc8eb14bd
6 changed files with 53 additions and 16 deletions
|
|
@ -279,17 +279,13 @@ void BlocksRenderer::blockCubeShaded(int x, int y, int z, const UVRegion(&texfac
|
|||
ivec3 loff(0);
|
||||
ivec3 coord(x, y, z);
|
||||
if (block->rotatable) {
|
||||
if (states == BLOCK_DIR_X) {
|
||||
Y = {1, 0, 0};
|
||||
X = {0, -1, 0};
|
||||
coord.y++;
|
||||
loff.y--;
|
||||
} else if (states == BLOCK_DIR_Z) {
|
||||
Y = {0, 0, 1};
|
||||
Z = {0, -1, 0};
|
||||
coord.z--;
|
||||
loff.z++;
|
||||
}
|
||||
auto& rotations = block->rotations;
|
||||
auto& orient = rotations.variants[states & BLOCK_ROT_MASK];
|
||||
X = orient.axisX;
|
||||
Y = orient.axisY;
|
||||
Z = orient.axisZ;
|
||||
coord += orient.fix;
|
||||
loff -= orient.fix;
|
||||
}
|
||||
|
||||
if (isOpen(x+Z.x, y+Z.y, z+Z.z, group)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue