feat: voxel fragment rotation applying to 'stairs' profile

This commit is contained in:
MihailRis
2025-04-30 21:56:04 +03:00
parent 3e2bf8a1d3
commit 12c7d4dfb4
2 changed files with 6 additions and 12 deletions
+4 -1
View File
@@ -209,10 +209,13 @@ std::unique_ptr<VoxelFragment> VoxelFragment::rotated(const Content& content) co
| ((voxel.state.segment & 0b100) >> 2);
auto& def = content.blocks.require(blockNames[voxel.id]);
if (def.rotations.name == BlockRotProfile::PANE_NAME ||
def.rotations.name == BlockRotProfile::PIPE_NAME){
def.rotations.name == BlockRotProfile::PIPE_NAME) {
if (voxel.state.rotation < 4) {
voxel.state.rotation = (voxel.state.rotation + 3) & 0b11;
}
} else if (def.rotations.name == BlockRotProfile::STAIRS_NAME) {
voxel.state.rotation = ((voxel.state.rotation + 3) & 0b11) |
(voxel.state.rotation & 0b100);
}
}
}