mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11: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
|
|
@ -336,17 +336,8 @@ static int determine_rotation(
|
|||
if (norm.y < 0.0f) return BLOCK_DIR_DOWN;
|
||||
if (norm.z > 0.0f) return BLOCK_DIR_NORTH;
|
||||
if (norm.z < 0.0f) return BLOCK_DIR_SOUTH;
|
||||
} else if (name == "pane") {
|
||||
if (abs(camDir.x) > abs(camDir.z)) {
|
||||
if (camDir.x > 0.0f) return BLOCK_DIR_EAST;
|
||||
if (camDir.x < 0.0f) return BLOCK_DIR_WEST;
|
||||
}
|
||||
if (abs(camDir.x) < abs(camDir.z)) {
|
||||
if (camDir.z > 0.0f) return BLOCK_DIR_SOUTH;
|
||||
if (camDir.z < 0.0f) return BLOCK_DIR_NORTH;
|
||||
}
|
||||
} else if (name == "stairs") {
|
||||
int verticalBit = ((norm.y - camDir.y * 0.5f) < 0.0) ? 4 : 0;
|
||||
} else if (name == "pane" || name == "stairs") {
|
||||
int verticalBit = (name == "stairs" && (norm.y - camDir.y * 0.5f) < 0.0) ? 4 : 0;
|
||||
if (abs(camDir.x) > abs(camDir.z)) {
|
||||
if (camDir.x > 0.0f) return BLOCK_DIR_EAST | verticalBit;
|
||||
if (camDir.x < 0.0f) return BLOCK_DIR_WEST | verticalBit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue