mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Vertical block rotation
This commit is contained in:
parent
4599f903e8
commit
ee7d79fe93
5 changed files with 21 additions and 28 deletions
|
|
@ -223,14 +223,12 @@ void PlayerController::updateInteraction(){
|
|||
if (def->rotatable){
|
||||
const string& name = def->rotations.name;
|
||||
if (name == "pipe") {
|
||||
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.0f) states = BLOCK_DIR_WEST;
|
||||
else if (norm.x > 0.0f) states = BLOCK_DIR_EAST;
|
||||
else if (norm.y > 0.0f) states = BLOCK_DIR_UP;
|
||||
else if (norm.y < 0.0f) states = BLOCK_DIR_DOWN;
|
||||
else if (norm.z > 0.0f) states = BLOCK_DIR_NORTH;
|
||||
else if (norm.z < 0.0f) states = BLOCK_DIR_SOUTH;
|
||||
} else if (name == "pane") {
|
||||
vec3 vec = camera->dir;
|
||||
if (abs(vec.x) > abs(vec.z)){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue