Members
add
approxEquals
cross
distance
dot
equals
format
- aVec3
- Undocumented
- digitsnumber
- Undocumented
isFinite3
- aVec3
- Undocumented
length
Uses hypot to keep magnitudes near the double range (a 1e20 m vector squares to 1e40).
- aVec3
- Undocumented
lengthSquared
- aVec3
- Undocumented
lerp
mul
negate
- aVec3
- Undocumented
normalize
- aVec3
- Undocumented
scale
- aVec3
- Undocumented
- snumber
- Undocumented
sub
toArray
- aVec3
- Undocumented
toFloat32
Round each component to float32.
Render coordinates end up in a Float32Array on the GPU, so tests use this to assert that a value actually survives the trip — asserting on doubles would pass for coordinates the renderer cannot represent.
- aVec3
- Undocumented
UNIT_X
UNIT_Y
UNIT_Z
vec3
- xnumber
- Undocumented
- ynumber
- Undocumented
- znumber
- Undocumented
Vec3
Double-precision 3-vector, in whatever frame the caller is holding.
This is not a universe position — see universeVector.ts for that. A Vec3 is always a displacement or a frame-local coordinate, where double precision is plenty (a 1e6 m local frame has 0.2 nm resolution).
Plain readonly objects rather than a class: they survive structuredClone
to a worker, JSON round-trips without a codec, and the engine keeps them in
one hidden class as long as the field order below is preserved everywhere.
withLength
Rescale to an exact magnitude. Returns ZERO for a zero-length input.
- aVec3
- Undocumented
- targetnumber
- Undocumented