Floating Origin Precision Fix

Problem

Tracer trails and orbital path lines jitter in the cockpit view because their Three.js object positions mix coordinate frames:

// Jittery: adds float32 scene position to scaled ICRF offset
position = refBody.sceneX + pivot.x * SCALE

sceneX is a float32 value (stored via body.position.x), and adding a small offset (pivot * SCALE) to it compounds float32 rounding errors across frames.

Fix

Compute positions from ICRF coordinates using icrfToScene, which performs the large subtraction (body - ship) in float64 JavaScript before scaling:

// Stable: single icrfToScene call, float64 subtraction
icrfToScene(position,
  bodyICRF.x + pivot.x, bodyICRF.y + pivot.y, bodyICRF.z + pivot.z,
  shipICRF.x, shipICRF.y, shipICRF.z, SCALE);

Files

  • services/web-client/src/tracers.js — tracer trail positioning
  • services/web-client/src/flightOverlays.js — orbital path positioning
  • services/web-client/src/cockpitExtrapolation.js — per-frame position updates

Back to top

Galaxy — Kubernetes-based multiplayer space game

This site uses Just the Docs, a documentation theme for Jekyll.