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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
//! Analytic reference fixtures shared by this crate's integration tests and
//! [`animsmith-testkit`](../../animsmith_testkit/index.html)'s committed
//! example assets.
//!
//! A `hips` + left/right-foot rig whose feet swing as antiphase
//! sinusoids, so the loop-seam / gait / root-motion metrics (which
//! FK-sample foot position relative to the hips) have real motion to
//! measure. The bone names are a [`WalkBones`] parameter: `semantic.rs`
//! wires explicit roles over `l_foot`/`r_foot` to unit-test the checks
//! with profile detection bypassed, while testkit uses `foot_l`/`foot_r`
//! so the committed `walk.glb` resolves the `ue-mannequin` profile
//! end-to-end. `periods`, `stride`, and the sine implementation are
//! parameters for the same reason — one closed loop vs. a popped seam, a
//! real stride vs. a tiny one, and a byte-stable trig for committed assets
//! vs. the platform sine for tolerance-checked tests. Passing the sine in
//! keeps this crate free of a trig dependency (see [`foot_track`]).
//!
//! The module also exposes [`build_scale_reference_candidate`] for scale-plan
//! contract tests. It is deliberately separate from the production flow,
//! where a format frontend rewrites exact source bytes and reloads the emitted
//! artifact before core proof.
//!
//! Behind the `fixtures` feature: testkit enables it, and this crate's own
//! tests reach it through a self dev-dependency that turns the feature on for
//! the test build.
use crate*;
use crate;
use Vec3;
use TAU;
/// Build the format-neutral reference candidate for an accepted scale plan.
///
/// This analytic fixture is not the production rewrite route. Format
/// frontends rewrite their exact source representation, reload the emitted
/// artifact, and wrap that document with [`ScaleCandidate::from_document`]
/// before calling [`crate::scale::prove_scale`]. This helper exists only for
/// reference, calibration, and cross-crate contract tests enabled through the
/// non-default `fixtures` feature.
///
/// The source `document` is never mutated. The same structural replay and
/// candidate validation errors as the private reference implementation are
/// returned unchanged.
/// Keyframe count: 32 intervals over the 1 s clip.
pub const WALK_KEYS: usize = 33;
/// Vertical foot swing amplitude, metres.
pub const WALK_FOOT_AMPLITUDE: f32 = 0.05;
/// Default fore/aft foot swing (stride), metres. Some tests vary it to
/// exercise the loop-seam stride floor.
pub const WALK_STRIDE: f32 = 0.15;
/// The bone names for the three-bone walk rig — a `hips` root with a left
/// and a right foot. A parameter so one consumer can pick
/// profile-resolving names and another explicit-role test names, off the
/// single skeleton shape.
/// One foot's translation track: an antiphase vertical + fore/aft
/// sinusoid over `periods` cycles with the given `stride`. `periods = 1.0`
/// closes the loop exactly (seam ≈ 0); a non-integer count leaves the feet
/// away from their first-frame pose — a popped seam.
///
/// `sin` is caller-supplied so this crate needs no trig dependency: a
/// consumer that commits the resulting bytes (the example-asset generator)
/// passes a platform-independent sine such as `libm::sin` for byte-stable
/// output, while an analytic test can pass `f64::sin` — its tolerances
/// absorb the platform sine's last-ulp wobble.
/// The analytic walk clip over `bones`: antiphase left/right foot tracks
/// running `periods` cycles at `stride`, in a clip named `clip`. `sin` is
/// the sine implementation (see [`foot_track`]).