.IFF in IGI 2 -- Skeletal Animation & 48-Bone Rig

1. Architectural Role & Engine Purpose

The IFF (Covert Strike Skeletal Animation Container) format drives high-fidelity motion-captured locomotion, multi-layered combat animations, prone crawling, ladder climbing, and death reactions in I.G.I. 2: Covert Strike.

In IGI 2, animations upgraded from Euler angle curves to unit quaternions with spherical linear interpolation (slerp). This eliminated gimbal lock and allowed dynamic runtime blending between upper-body weapon aiming and lower-body running animation tracks.

2. Binary File Layout & Memory Map Diagram

An IGI 2 IFF file organizes bone hierarchies, quaternion curves, and root motion vectors:

IGI 2 IFF ANIMATION — QUATERNION SKELETAL CONTAINER LAYOUT 0x00: FORM ANM2 Header (12 Bytes) ANM2 CHUNK FourCC "FORM" | File Size (Big-Endian) | Form Type "ANM2" (0x324D4E41) form[4], file_size, form_type[4] HEAD Chunk: Animation Metadata HEAD CHUNK Duration (float seconds), Frame Count, Sample Rate (30 FPS), Bone Count Supports multi-layer animation blending BONE Chunk: Skeletal Hierarchy BONES Parent bone indices & inverse bind pose 4x4 matrices Hierarchical skeletal joint tree QUAT & TRAN Chunks: Unit Quaternion Keyframes & Root Motion SLERP QUATERNIONS Rotational tracks stored as unit quaternions (X, Y, Z, W) • Eliminates gimbal lock completely Slerp interpolation between upper-body weapon aiming and lower-body running cycles

3. Multi-Track Animation Blending Pipeline Diagram

The skeletal engine blends separate animations for upper and lower body joints simultaneously:

IGI 2 IFF — DUAL-TRACK QUATERNION SLERP PIPELINE 1. DUAL TRACKS • Track 0: Run Locomotion • Track 1: Weapon Aim/Fire • DeltaTime Sampling 2. LAYER WEIGHTS • Per-Bone Layer Masks • Upper Body Weight = 1.0 • Lower Body Weight = 0.0 3. QUAT SLERP • Spherical Linear Interp • Zero Gimbal Lock • Smooth Seamless Blending 4. D3D8 MATRIX • GPU Matrix Palette • Hardware Skinning • Realistic Combat Pose

4. C++ Struct Definitions

#pragma pack(push, 1)
struct IffAnimHeaderIgi2 {
    char     form[4];        // "FORM"
    uint32_t file_size;      // Big-Endian size
    char     anim_type[4];   // "ANM2"
    char     head[4];        // "HEAD"
    uint32_t head_size;      // Header chunk size
    float    duration;       // Duration in seconds
    uint32_t frame_count;    // Keyframe count
    uint16_t sample_rate;    // 30 Hz
    uint16_t bone_count;     // Total bones in skeleton
};

struct IffQuatKeyframe {
    float    qx, qy, qz, qw; // Unit rotation quaternion
};
#pragma pack(pop)