1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2026 Fernando Sahmkow
/**
* @file d3_anim.h
* @brief Diablo III animation import (design §10.8.3, the Diablo3 row).
*
* ### One permutation is one clip
*
* An `.ani` is a small set of *permutations* — variants of one action, picked at
* play time by weight — and each carries its own frame count, rate, bone list
* and curves. So the clip is the permutation, and the `.ani` is a group of them
* that an anim set names as one.
*
* ### The join is a bone **name**
*
* Unlike every other field D3 joins by index, a permutation names its bones as
* 64-byte strings and matches them against the appearance's `BoneStructure`
* names — 4-byte hashes at runtime, strings on disk. That is what lets one
* `.ani` drive several appearances, and it is why a name the model does not
* carry is a skipped track and not an error.
*
* ### Frames are not seconds and the rate is per permutation
*
* `fps = flFramesPerTick * 60` (`Anim_InitPlaybackState`), so a key at frame *f*
* is at `f / fps` seconds and the clip runs `(frameCount - 1) / fps`. The
* "-1" is the engine's: the last frame is the end of the last *span*, not a
* frame of its own.
*
* ### The rotation is a signed 16-bit quaternion, w last
*
* `x / 32767` per component, then normalised. The `u16` fields are signed data;
* reading them unsigned mirrors every rotation past a half turn.
*/
namespace whiteout // namespace whiteout