Whenever a model is changed, we prepare a bi-directional
name <-> id (byte) lookup table using which we can further
cut down the number of bytes used.
I also decided to avoid sending any bones which are in their
rest position. We're down to ~200 bytes, plus an additional
~200 for each hand tracked.
This commit breaks blendshape synchronization. I would like
to grab the data directly from the model / animation system,
rather than relying on "blend_shape_last_values".
Instead of relying on Godot packing up dictionaries with variants
in a compact way (which it doesn't), we're building our own packet
from scratch with a new StreamBuffer type which helps with writing
and reading data to and from a PackedByteArray.
To cut down on data, we don't send a full Transform3D per bone.
We send position, rotation and scale separatetly as 16-bit floats,
instead of the twelve 32-bit floats of a Transform3D. We also skip
anything that's approximately default, like position and scale
might often be.
This helped cut down the size of packets to about 1500 bytes,
or 800 with compression, since we're still sending strings.
This is a very simple approach to reducing the number of
bones send through sync_model_animation, done by simply
specifying a filter list. Only bones in the list, assuming
they exist on the model, are considered.