A channel (CHNL component) is a named value of a model, kept within its range, which moves what it's bound to. The game now
follows its bindings to joints and to clips.
- A joint binding (a JOIN component of a node): the value of the target (channel * scale + offset) turns a hinge (radians)
or a screw (turning and moving by its pitch), or moves a slider (metres) along the axis of the joint, from the transform
of the node, within the limits of the joint when it has them; a fixed or a ball joint leaves the node at rest
(animation::joint_transform()).
- A clip binding: the value of the target is the share of the duration of the clip, 0 to 1, so the channel scrubs the clip
without playing it.
- Bindings to variants and light slots are read but not followed yet.
- Format, before the release: the target of a clip binding is the index of the clip in ACLP (clips aren't components); the
validator checks the target by the kind of the binding (a joint has to be a JOIN component).
- TAnimModel::set_channel(name, value); a channel not set has its initial value. RaPrepare() sets the nodes from the
channels after the clips playing, so a channel overrides a clip on the same node. The nodes of the joints are flagged
animated at load, which keeps the model out of the instancing.
- New form of the animation event: "animation <delay> <model> channel <name> <value>"; a channel the model hasn't gets
"Bad event: ... can't find channel ..." in the log. The current release doesn't read the new form.
- The editor self-test gets "channel <node> <name> <value>".
Checked in the game (Vulkan, a skinned tube with a hinge on its tip and a clip on its base): "bend 1" from the self-test
and "bend -1" from an event turn the tip both ways, "phase 0.5" from an event turns the whole tube through the clip, an
unknown channel logs the error. Unit tests 1204/1204, 4 new ones for the hinge, slider, screw and limits, the range of a
channel and the targets of the bindings in the file. Not built with GCC here.
Stage 8 of the EU07M model format. A model can carry animation clips; each track of a clip sets the translation, the
rotation or the scale of a node at a time of the clip, and the parts of a node without a track keep its TRS.
- Format, five optional sections: ACLP (clips: name, duration, flags 0x1 loop and 0x2 autoplay, range of tracks), ATRK
(tracks: node, part, interpolation step / linear / cubic, ranges of keys), ATIM (key times), AVEC (vectors; with cubic
the in-tangent, value and out-tangent of glTF) and AROT (rotations in 8 bytes, "smallest three": the three smaller
components as snorm16 scaled by sqrt(2) and the index of the largest; eu07m::encode_rotation / decode_rotation).
The validator refuses a node out of range, keys out of their arrays, times which aren't numbers from 0 up, a cubic
rotation and tracks out of the range of the clip. -eu07m dump lists the clips and their tracks. The current release
doesn't read these sections; a file without them loads as before.
- Sampling (model/clip.cpp): step, lerp / slerp the shorter way, the Hermite spline of glTF with tangents per second;
the first and the last key held outside of them; a looped clip goes around its duration, another stops at its end.
- In the game: the clips play by the simulation time, from TAnimModel::play_clip(name, speed) or, flagged autoplay, from
the first time the instance is drawn. RaPrepare() samples them for the instance drawn and sets the transforms of the
nodes (TSubModel::SetClipTransform(), the new animation type at_Clip, gated by the instance like the others), so a clip
moving the joints of a skin bends the skinned parts. The nodes a clip moves are flagged animated at load, which keeps
the model out of the instancing. stop_clips() stops them.
- The editor self-test gets "clip <node> <name> [speed]".
Not yet: a scenery event starting a clip, and the CHNL channels bound to the time of a clip.
Checked: a skinned tube with an autoplay clip (the tip to 60 degrees and back in 2 s, looped) beside a still one, six
screenshots in Vulkan and in GL 4.6 go from straight to fully bent while the other stays (time let run in the editor for
the test only). Unit tests 1200/1200, 6 new ones for the packing, the interpolations, the time and the file. Not built
with GCC here.