public class SerializationHelper
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static float |
decodeAngle(byte encodedAngle)
Decodes a previously encoded angle.
|
static float |
decodeAngleFromShort(short encodedAngle) |
static float |
decodeSmallFloatingPointNumber(short encodedNumber,
int precision)
Decodes a small floating point number, previously encoded with
encodeSmallFloatingPointNumber. |
static byte |
encodeAngle(float angle)
Encodes an angle, loosing some precision.
|
static short |
encodeAngleToShort(float angle) |
static short |
encodeSmallFloatingPointNumber(float smallNumber,
int precision)
Encodes positive numbers less than Short.MAX_VALUE * 2 / precision (6553.4
for precision = 1).
|
public static float decodeAngle(byte encodedAngle)
encodedAngle - The encoded angle.public static float decodeAngleFromShort(short encodedAngle)
public static float decodeSmallFloatingPointNumber(short encodedNumber,
int precision)
encodeSmallFloatingPointNumber.encodedNumber - The encoded numberprecision - The precision of the encoded number. The same precision, used for
encoding.public static byte encodeAngle(float angle)
angle - The anglepublic static short encodeAngleToShort(float angle)
public static short encodeSmallFloatingPointNumber(float smallNumber,
int precision)
smallNumber - The small number to encodeprecision - The comma precision for the encoding process.