Closed anion155 closed 9 years ago
This line does not change anything. It's instantly rewriting by this (float) Math.toRadians(ship.rotationYaw)
Please note the call to the Math.round function. I will give you an example: yaw = 132.0; yaw / 90.0 = 1.467; Math.round(yaw / 90.0) = Math.round(1.467) = 1.0; Math.round(yaw / 90.0) * 90.0 = 1.0 * 90.0 = 90.0; A yaw of 132.0 degrees results in 90.0 degrees.
Well, maybe you wanted to do something like this:
float yaw = Math.round(ship.rotationYaw / 90F) * 90F;
yaw = (float) Math.toRadians(yaw);
instead of
float yaw = Math.round(ship.rotationYaw / 90F) * 90F;
yaw = (float) Math.toRadians(ship.rotationYaw);
'cause the result of Math.round(ship.rotationYaw / 90F) * 90F
doesn't saves anywhere.
or even like this
ship.rotationYaw = Math.round(ship.rotationYaw / 90F) * 90F;
float yaw = (float) Math.toRadians(ship.rotationYaw);
Aha, I see now. Thank you! I'm sorry for not understanding you the first time. It has always worked well because the ship always aligns before disassembling.
This line is required to line out the ship with the grid. It rotates the blocks to the nearest straight angle relative to the grid while disassembling the ship.