mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
feat: voxel fragment rotation applying to 'stairs' profile
This commit is contained in:
parent
3e2bf8a1d3
commit
12c7d4dfb4
2 changed files with 6 additions and 12 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue