ANIM (File Format): Difference between revisions

Jump to navigation Jump to search
imported>Jackoalan
imported>Jackoalan
Line 138: Line 138:
In addition to the bitstream quantization, the format includes a bitmap specifying which frames of the animation have
In addition to the bitstream quantization, the format includes a bitmap specifying which frames of the animation have
keys added. Consequently, the runtime generates missing keys via interpolation (reducing animation size further).  
keys added. Consequently, the runtime generates missing keys via interpolation (reducing animation size further).  
=== Key Values ===
When decoding the animation, each bone's rotation (and possibly translation) values are initialized to the ''initial_*''
values in the ''bone channel descriptors''. For every frame of every bone channel, the key value in the bitstream is ''added''
with the previous key value (to resolve the delta encoding).
Once resolved, rotation components are divided by ''rotation_divisor'', resulting in an axis-angle
[[wikipedia:Axis–angle_representation#Rotation_vector|rotation vector]]. The magnitude of this vector
is the ''angle'' part and is multiplied by 𝛑 and combined with the ''angle sign-bit'' to get the rotation in radians.
Translation components are multiplied by ''translation_multiplier'', yielding world coordinates.


{| class="wikitable"
{| class="wikitable"
Line 173: Line 184:
|<remainder of file>
|<remainder of file>
|key_bitstream
|key_bitstream
|Word-packed bitstream laid out as described by the descriptor table. The bitstream is unpacked just like ''key_bitmap''
|Word-packed bitstream laid out as described by the descriptor table. The bitstream is unpacked just like ''key_bitmap''.
Key values are tightly-packed, quantized integers whose bit-depth is specified by the ''q_*'' values in the descriptor table.
Each bone-channel key-set starts with a single bit providing the ''angle sign-bit'' (1 for negative, 0 for positive).
The key integers are signed using [[wikipedia:Two's complement|Two's complement]] representation.
|}
|}


Anonymous user

Navigation menu