ANIM (File Format): Difference between revisions
Jump to navigation
Jump to search
no edit summary
imported>Jackoalan |
imported>Jackoalan No edit summary |
||
Line 10: | Line 10: | ||
|- | |- | ||
|0x0 | |0x0 | ||
|[[#Quaternion Array Format|Quaternion | |[[#Quaternion Array Format|Quaternion Array Format]] | ||
|- | |- | ||
|0x2 | |0x2 | ||
|[[#Bitstream Format|Rotation | |[[#Rotation Vector Bitstream Format|Rotation Vector Bitstream Format]] | ||
|} | |} | ||
Line 39: | Line 39: | ||
|header‑>bone_entry_count | |header‑>bone_entry_count | ||
|bone_entry_map | |bone_entry_map | ||
|The index-positions of this table correspond to the ''bone ids'' in the associated CINF. The value is 0xff if the bone is not animated by this ANIM or an index relating the ''bone_translation_map'' and ''quaternion_key_array'' below | |The index-positions of this table correspond to the ''bone ids'' in the associated [[CINF (File Format)|CINF]]. The value is 0xff if the bone is not animated by this ANIM or an index relating the ''bone_translation_map'' and ''quaternion_key_array'' below | ||
|- | |- | ||
|long | |long | ||
Line 128: | Line 128: | ||
|} | |} | ||
== Bitstream Format == | == Rotation Vector Bitstream Format == | ||
The '''Rotation Vector Bitstream Format''' is the most widely used animation format in ''Metroid Prime''. | |||
The format uses a compressed [[wikipedia:Bitstream|bitstream]] to store keys that have been | |||
[[wikipedia:Delta encoding|delta encoded]] and [[wikipedia:Quantization (signal processing)|quantized]] | |||
to make for a very compact, compressed animation. The data is processed sequentially to reconstruct the | |||
decompressed bone channel data. | |||
In addition to the bitstream quantization, the format includes a bitmap specifying which frames of the animation have | |||
keys added. Consequently, the runtime constructs missing keys via interpolation (reducing animation size further). | |||
=== Header2 === | |||
{| class="wikitable" | |||
!Offset | |||
!Length | |||
!Data Type | |||
!Identifier | |||
!Notes | |||
|- | |||
|0x0 | |||
|4 | |||
|long | |||
|scratch_size | |||
|Amount of memory that the animation system needs to allocate to process animation | |||
|- | |||
|0x4 | |||
|4 | |||
|long | |||
|evnt_ref | |||
|ID for this ANIM's [[EVNT (File Format)|EVNT]] resource, or 0xffffffff if no events triggered | |||
|- | |||
|0x8 | |||
|4 | |||
|long | |||
|unknown0 | |||
|Always 0x1 | |||
|- | |||
|0xC | |||
|4 | |||
|float | |||
|duration | |||
|Time in seconds that the animation plays for | |||
|- | |||
|0x10 | |||
|4 | |||
|float | |||
|interval | |||
|Time in seconds between keys of each bone channel (reciprocal of frame-rate) | |||
|- | |||
|0x14 | |||
|4 | |||
|long | |||
|unknown1 | |||
|Always 0x3 | |||
|- | |||
|0x18 | |||
|4 | |||
|long | |||
|unknown2 | |||
|Always 0x0 | |||
|- | |||
|0x1C | |||
|4 | |||
|long | |||
|rotation_divisor | |||
|Rotation vectors are divided by this value before being applied | |||
|- | |||
|0x20 | |||
|4 | |||
|float | |||
|translation_multiplier | |||
|Translation vectors are multiplied by this value before being applied | |||
|- | |||
|0x24 | |||
|4 | |||
|long | |||
|bone_channel_count | |||
|Count of bone channels present in ANIM | |||
|- | |||
|0x28 | |||
|4 | |||
|long | |||
|unknown3 | |||
|Always 0x1 | |||
|- | |||
|0x2C | |||
|4 | |||
|long | |||
|key_bitmap_length | |||
|Number of bits in ''key bitmap'' | |||
|} | |||
[[Category:File Formats]] | [[Category:File Formats]] |