Using Unity. I need to used fixed point to network some data deterministically. How do I convert a fixed point back into a float so that I can apply it to the objects transform?
public class Fixed
{
private int front;
private int back;
private const uint MAX_32 = 4294967295;
}
This is the class I have for the fixed point number.
Don't overthink it. Just scale your real number by a constant amount (ideally a power of two or ten, depending on your needs) and store in an integer. To convert back, divide by the same amount. In your case, consider multiplying the floating-point value by 4294967296.0 and assigning to a
long.