mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 17:37:09 +01:00
55c7050c49
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.