Fixed field order in spherical values in messages

This commit is contained in:
Pascal Serrarens 2024-12-14 12:42:14 +01:00
parent e975f219f4
commit b34c536c68

View File

@ -5,16 +5,16 @@ public class LowLevelMessages
public static void SendSpherical(byte[] buffer, ref byte ix, Spherical v)
{
SendFloat16(buffer, ref ix, new float16(v.distance));
SendAngle8(buffer, ref ix, v.horizontal);
SendAngle8(buffer, ref ix, v.vertical);
SendFloat16(buffer, ref ix, new float16(v.distance));
}
public static Spherical ReceiveSpherical(byte[] data, ref byte ix)
{
float distance = ReceiveFloat16(data, ref ix);
float horizontal = ReceiveAngle8(data, ref ix);
float vertical = ReceiveAngle8(data, ref ix);
float distance = ReceiveFloat16(data, ref ix);
Spherical v = new(distance, horizontal, vertical);
return v;
}