vec3ScaleToLength
vec3ScaleToLength(
v,length):Vec3
Defined in: src/modules/math/vec3.ts:168
v rescaled so its length equals length, direction preserved — the
canonical “normalize then multiply” for driving a body at a fixed speed from
an arbitrary direction. A zero-length input returns { 0, 0, 0 }. Sibling of
vec2ScaleToLength.
Parameters
Section titled “Parameters”length
Section titled “length”number