I want to write some radian angles to a binary file. Is there any way I can save space while doing so?
I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that wasn’t going to work…
Any ideas?
EDIT: I only need 2 or 3 decimal points precision
There is a method from the Quake source code that writes them out as a byte like this:
Then reads it in like this:
Which I tested and it leaves about 2 decimal places of precision, which should be okay for me.