stanceToward

function stanceToward
surfaceStance.ts:211
stanceToward(up: Vec3, forward: Vec3) → { heading: number; pitch: number }

A forward direction, as the heading and pitch a stance holds.

The inverse of the along/forward construction below, and it lives beside it because the two have to agree about what heading 0 means: north, swinging toward east, measured in the triad localTriad builds on the pole of whatever axes up is expressed in. That last clause is the whole reason this is a function rather than four lines at each call site — a heading solved in one frame and applied in another is a silent rotation about the local vertical, and on a tilted body it is the axial tilt's worth of it.

up and forward must therefore be in the same axes, and the answer is about those axes.

upVec3
Undocumented
forwardVec3
Undocumented
Returns{ heading: number; pitch: number }