urho3d/Urho3D — pull request #582 by pfanne (2014-12-28 17:16:10+00:00)
Title: changed the packed quaternion to half the size

I changed the (de)serializer for the packed quaternion to use 4 instead of 8 bytes.
This is possible by reducing the depth for each component to 10 bits and only sending 3 components.
10 Bits seems to still be precise enough as to not notice any artifacts.
Since the fourth component can be computed from the other 3 by using the knowledge that the quaternion is normalized it can be omitted.
By always sending the 3 smallest components the error when computing the fourth component is minimized.
The highest 2 bits are used to encode which of the 4 components was omitted.
The packed quaternion looks someting like this:
H------------------------------------------------L
oo|aaaaaaaaaa|bbbbbbbbbb|cccccccccc

where
- o are the 2 bits for encoding the offset of the omitted component
- a, b and c are the components following the omitted one

I have tested this code with NinjaSnowWar as well as the SceneReplicationDemo and haven't noticed any issues or noticable loss of precision