You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overdrive cables: weld twig roots to the trunk's emitted rail vertex
Twigs are emitted by separate GS invocations, so they only stay attached to
the trunk if they rebuild the exact geometry the tent invocations emit. The
old root anchor offset 0.2*halfW along the twig's LOCAL-normal B from a
max-of-window spawn at the belly: on slopes that point both diverged from the
trunk's frame and sat ~tentHeight below the visible tube, detaching the twig —
and tightening the wiggle noise (previous commit) shifted the trunk enough to
expose the mismatch everywhere.
Root on the rail instead: the twig dispatch already replays
placeRibbonVertices and picks an emitted vertex (bestK); now it also rebuilds
that vertex and its predecessor (same wigglyCablePoint xz, same base height)
and hands them to emitTwig, which reconstructs the local rail frame — the
back-diff vtxTangent and its horizontal perpendicular B_v, exactly as
emitTentHalf builds them — and places the root at center + B_v*halfW*side
with the same SIDE_CLEAR clamp: the very outer-rail vertex the trunk renders,
plus a small Navg*TWIG_CLEAR lift against z-fighting.
The chord-averaged normal moves into a shared cableNavg() helper so trunk pad,
apex and twig lift all ride one axis. The twig's in-slope growth basis B is
sign-aligned to B_v so a wild local terrain normal can't flip the twig back
across the trunk it roots on.
Reworked from a pre-rail-refactor stash that shared a global cross frame
(cableCrossFrame/B3); master's per-vertex transverse axis (30b1907) made
that approach obsolete, so the sync is re-expressed in rail terms.
0 commit comments