ZeppelinMC / Zeppelin

Highly efficient Minecraft server
Apache License 2.0
276 stars 20 forks source link

A question on function #23

Open ktalap opened 2 days ago

ktalap commented 2 days ago
func DegreesToAngle(degrees float32) byte {
    return byte(math.Round(float64(degrees) * (256.0 / 360.0)))
}

func AngleToDegrees(angle byte) float32 {
    return float32(angle) * (360.0 / 256.0)
}

I think it should be degrees to radians and radians to degrees. I mean the ratio will work itself out to the same value, but what's the point of that thing. Shouldn't it be pi/180 and 180/pi?

oq-x commented 2 days ago

Sometimes rotations are in angle and sometimes in degrees (in the protocol)

ktalap commented 1 day ago

Angle has units of either radians or degrees.

oq-x commented 1 day ago

Yea well that’s just how it’s encoded someone told me how to switch between the two idk

ktalap commented 1 day ago

Gotta rework it then, check my pull request man. I added some guide for the server installation.