Class QuaternionCompressor
A Smallest Three Quaternion Compressor Implementation
Inherited Members
Namespace: Unity.Netcode
Assembly: solution.dll
Syntax
public static class QuaternionCompressor
Remarks
Explanation of why "The smallest three": Since a normalized Quaternion's unit value is 1.0f: xx + yy + zz + ww = MM (where M is the magnitude of the vector) If w was the largest value and the quaternion is normalized: M = 1.0f (which M * M would still yield 1.0f) ww = MM - (xx + yy + zz) or Mathf.Sqrt(1.0f - (xx + yy + zz)) w = Math.Sqrt(1.0f - (xx + yy + zz)) Using the largest the number avoids potential loss of precision in the smallest three values.
Methods
Name | Description |
---|---|
Compress |
Compresses a Quaternion into an unsigned integer |
Decompress |
Decompress a compressed quaternion |