mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
Full vertical block rotation
This commit is contained in:
parent
8bc8eb14bd
commit
361a2eac67
4 changed files with 20 additions and 19 deletions
|
|
@ -216,14 +216,12 @@ void PlayerController::updateInteraction(){
|
|||
uint8_t states = 0;
|
||||
|
||||
if (contentIds->getBlockDef(player->choosenBlock)->rotatable){
|
||||
if (abs(norm.x) > abs(norm.z)){
|
||||
if (abs(norm.x) > abs(norm.y)) states = BLOCK_DIR_X;
|
||||
if (abs(norm.x) < abs(norm.y)) states = BLOCK_DIR_Y;
|
||||
}
|
||||
if (abs(norm.x) < abs(norm.z)){
|
||||
if (abs(norm.z) > abs(norm.y)) states = BLOCK_DIR_Z;
|
||||
if (abs(norm.z) < abs(norm.y)) states = BLOCK_DIR_Y;
|
||||
}
|
||||
if (norm.x > 0) states = BLOCK_DIR_PX;
|
||||
else if (norm.x < 0) states = BLOCK_DIR_MX;
|
||||
else if (norm.y > 0) states = BLOCK_DIR_PY;
|
||||
else if (norm.y < 0) states = BLOCK_DIR_MY;
|
||||
else if (norm.z > 0) states = BLOCK_DIR_PZ;
|
||||
else if (norm.z < 0) states = BLOCK_DIR_MZ;
|
||||
}
|
||||
|
||||
Block* block = contentIds->getBlockDef(vox->id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue