feat: migrate simulation to physically-based unit system

Replace arbitrary game units with real-world measurements throughout
the simulation and viewer: planet orbits in AU, sizes in km, galaxy
positions in light-years. Add SimulationUnits helpers for conversions,
separate WarpSpeed from FtlSpeed for ships, fix FTL transit progress
to use galaxy-space distances, overhaul Lagrange point placement with
Hill sphere approximation, and update the viewer to scale and format
all distances correctly. Ships in FTL transit now render in galaxy view.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 14:21:20 -04:00
parent 5ba1287f85
commit 5df5111463
34 changed files with 1558 additions and 456 deletions

View File

@@ -0,0 +1,15 @@
namespace SpaceGame.Simulation.Api.Simulation;
public static class SimulationUnits
{
public const float KilometersPerAu = 149_597_870.7f;
public const float MetersPerKilometer = 1000f;
public static float AuToKilometers(float au) => au * KilometersPerAu;
public static float AuPerSecondToKilometersPerSecond(float auPerSecond) =>
auPerSecond * KilometersPerAu;
public static float MetersPerSecondToKilometersPerSecond(float metersPerSecond) =>
metersPerSecond / MetersPerKilometer;
}