Members
approxEquals
- aUniverseVector
- Undocumented
- bUniverseVector
- Undocumented
- epsilonnumber
- Undocumented
approxMeters
Absolute position as plain meters. Lossy by construction (that is the whole point of UniverseVector) — for display, coarse culling and tests only.
- uvUniverseVector
- Undocumented
difference
a - b as a displacement in meters.
Valid at any separation: the result is a double, so a galaxy-crossing difference is quantized to ~1e5 m, while the near-field differences that actually feed physics and rendering keep full double precision.
- aUniverseVector
- Undocumented
- bUniverseVector
- Undocumented
distance
- aUniverseVector
- Undocumented
- bUniverseVector
- Undocumented
distanceSquared
Squared distance without the sqrt. Overflows to Infinity past ~1e154 m; harmless here.
- aUniverseVector
- Undocumented
- bUniverseVector
- Undocumented
equals
- aUniverseVector
- Undocumented
- bUniverseVector
- Undocumented
format
- uvUniverseVector
- Undocumented
fromMeters
Build from absolute meters.
The conversion itself is exact; the input is a double, so a galactic-scale literal has already lost precision before it arrives (~2 km at 1e19 m). That is fine for the only thing that uses it — placing catalog stars, whose published positions are uncertain by far more than that — and wrong for anything else, which should be translating from an existing position instead.
- xnumber
- Undocumented
- ynumber
- Undocumented
- znumber
- Undocumented
fromVec3
- vVec3
- Undocumented
isValid
- uvUniverseVector
- Undocumented
POSITION_RESOLUTION
Worst-case position resolution anywhere in the universe, in meters.
SECTOR_EXPONENT
log2 of the sector edge length in meters.
SECTOR_INDEX_LIMIT
Exclusive bound on |sector index| — sector indices are int32.
SECTOR_SIZE
Sector edge length in meters (2^40 ≈ 7.35 AU).
sectorKey
Stable key for the containing sector — used by spatial indexes and streaming.
- uvUniverseVector
- Undocumented
translate
Move by a displacement expressed in universe axes.
- uvUniverseVector
- Undocumented
- deltaVec3
- Undocumented
UNIVERSE_HALF_EXTENT
Half the addressable universe, in meters.
UNIVERSE_ORIGIN
universeVector
- sxnumber
- Undocumented
- synumber
- Undocumented
- sznumber
- Undocumented
- oxnumber
- Undocumented
- oynumber
- Undocumented
- oznumber
- Undocumented
UniverseVector
Absolute position in the universe.
Invariant, maintained by every constructor here: each offset component lies
in [0, SECTOR_SIZE) and each sector component is an integer in
(-SECTOR_INDEX_LIMIT, SECTOR_INDEX_LIMIT). Callers must not build these by
object literal; use universeVector / fromMeters / translate.