Skip to main content

to_angle_byte

Function to_angle_byte 

Source
pub const fn to_angle_byte(degrees: f32) -> i8
Expand description

Converts degrees to a protocol angle byte (0-255 representing 0-360 degrees).

Mirrors vanilla’s Mth.packDegrees(): (byte)floor(angle * 256.0F / 360.0F)