18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 12:25:27 +01:00
Files
maszyna/rendering
maj00r 35b70ce8d5 feat(vehicle): hoses bent along their chain, coupled head to head and swinging with inertia
A new .mmd entry, bonebend, bends a submodel made in one piece (the hoses of the existing models, pneumatic*) along
a spine of points: each vertex follows the nearest piece of the spine, the turn carried along it from the cock so
the rubber twists evenly. With head, the coupling head is held as one to the line between two points and the
vertical of the world, so the heads of two coupled hoses stay together on one plane. The vertices are bent on the
CPU into the vehicle's own copy of the submodel, drawn in its place.

The chains (bonechain) now:
- keep every other node at its distance as made, so a hose keeps its curve rather than folding;
- damp only the swing against the vehicle, so a hose goes along with the vehicle's own motion;
- average what the lengths ask of each node: the plain sum overshot, and a chain shivered and stretched by a fifth;
- take up to 64 nodes, enough for one chain from a cock to the cock of the next vehicle with the head node
  between: both vehicles get the same chain, and the coupled heads lag and swing with the hoses;
- move once a frame, by the render time, not once a render pass.

Assets: none needed. A vehicle without bonebend lines in its .mmd is drawn as before; bones_doc.md has the entries
for an EU07 hose. Tried on a local test copy of the EU07 (dynamic/test/4e_kosci, not in the SVN), not on a vehicle
of the SVN yet.
2026-11-25 02:40:05 +01:00
..