Writes a §28 joint axis into a Rapier 2D vector as a unit direction in
the XY plane (§21, §85) — the form JointData.prismatic wants.
Rapier normalizes the axis itself (measured: a prismatic joint built with
(3, 0) and limits ±1 still stops at x = ±1, i.e. the limits are metres
along the normalized axis), so normalizing here changes no simulation. It
is done anyway because it makes that fact explicit at the boundary instead of
leaving a reader to wonder whether limits are scaled by the axis length.
The zero vector is rejected: it names no direction, and Rapier's own
constructor answers undefined for it, which would surface much later as a
confusing failure inside createImpulseJoint.
Writes a §28 joint axis into a Rapier 2D vector as a unit direction in the XY plane (§21, §85) — the form
JointData.prismaticwants.Rapier normalizes the axis itself (measured: a prismatic joint built with
(3, 0)and limits±1still stops atx = ±1, i.e. the limits are metres along the normalized axis), so normalizing here changes no simulation. It is done anyway because it makes that fact explicit at the boundary instead of leaving a reader to wonder whetherlimitsare scaled by the axis length.The zero vector is rejected: it names no direction, and Rapier's own constructor answers
undefinedfor it, which would surface much later as a confusing failure insidecreateImpulseJoint.