Vixen
dd8b0a81
csharp
public sealed class NetworkBonePrecision

How many bits each bone of a pose is worth.

Read the guide page for this →

Remarks

A finger does not need what a spine needs. A rotation costs two bits naming the dropped component and three quantized levels, and ten bits a level is what a shoulder wants — the error compounds down the chain, so the joint nearest the root is the one whose precision everything below it inherits. A finger's own error reaches nothing, is a centimetre at the tip, and is being watched by nobody. This is where a game says so.

Indexed by slot in the selection, not by joint index, because the wire layout is a property of the replicator and the joint indices are a property of a rig. That has a consequence worth stating rather than discovering: a game using a narrowed table must order every character's NetworkBoneSelection the same way, and the natural way is most-important-first. Slot 0 is then the pelvis on every rig in the game and the table means the same thing for all of them.

⚠ It cannot live on NetworkBoneSelection, which is where Vixen.Net.Animation's own README suggested it should. The selection is per-entity, and a per-entity precision is a wire format that varies per entity: the delta codec checks a fixed lane width and the connection baselines are compared against one layout, so nothing on either side could parse it. This is the same argument NetworkTransformAxes makes for the mask being the replicator's rather than the entity's, and it lands the same way.

Fields and properties (6)

  • public const int MaxBits

    The most a bone can be worth, which is what MathCodec packs.

  • public const int MinBits

    The least. Sixteen levels over ±1/√2 is about five degrees a component.

  • public static NetworkBonePrecision Full

    Every bone at full precision — what ships, and what costs 32 bits a bone.

  • public bool IsFull

    Whether this is Full's table, in which case the wire is unchanged.

  • public string Suffix

    One character per slot, naming its width. Empty for Full, so the shipped replicator keeps the bare type name and the wire id it has today.

  • public int this[int slot]

    How many bits the bone in a slot is worth.

Methods (2)

  • public static NetworkBonePrecision Uniform(int bits)

    The same width for every bone.

  • public static NetworkBonePrecision For(ReadOnlySpan<int> bits)

    A width per slot, shortest-first, with the rest left at full precision.

Used by (4)

  • NetworkAnimationSystemsVixen.Net.Animation
  • NetworkAnimationWiringTestsVixen.Net.Animation.Tests
  • NetworkBonesReplicatorVixen.Net.Animation
  • NetworkBonesTestsVixen.Net.Animation.Tests