Povstalec / StargateJourney

A repository for the Stargate Journey Minecraft Mod
44 stars 21 forks source link

CC:Tweaked Stargate interface call "getRotation()" reports incorrect value #119

Open Kitsune-Ultima opened 3 months ago

Kitsune-Ultima commented 3 months ago

getRotation() reports 78 degrees when symbol 0 is rotated 180 degrees from initial position, also reports 155 degrees when rotated clockwise by "1 degree" (should be 359)

Povstalec commented 2 months ago

Ohhh, right. Yeah at some point I changed rotation in a way that 156 rotation units are equal to 360° so the rotation is technically correct. The reason for that change is that 156 is perfectly divisible by 39, the number of symbols on the Milky Way gate, so there is no room for any rounding errors.

Probably should have mentioned it somewhere in the interface function list.

You can easily convert to degrees just by multiplying the number by 360 and dividing by 156:

local rotationDegrees = interface.getRotation() * 360 / 156

If needed, I can also add a getRotationDegrees() function.