Add mass driver station system with Lagrange point placement

- Lagrange point computation (L1-L5) for any Sun-planet pair in Rust
- Station generation: auto-place at Lagrange points by priority (inner → outer planets)
- Station panel UI: count slider (5-50), launch velocity slider (5-100 km/s) with info tooltip
- Blue diamond markers on 2D canvas with labels when zoomed in
- Active station list in sidebar (Earth L1, Mars L2, Jupiter L4, etc.)
- WASM API: generate_stations(), get_station_positions(), get_station_names()
- Station positions update every frame (co-rotating with planets at Lagrange points)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-08 12:00:36 -07:00
parent 067ef1f557
commit a2daa2d617
10 changed files with 449 additions and 25 deletions

View File

@@ -6,6 +6,7 @@
import Viewport from './(simulator)/components/Viewport.svelte';
import TimeControls from './(simulator)/components/TimeControls.svelte';
import ViewToggle from './(simulator)/components/ViewToggle.svelte';
import StationPanel from './(simulator)/components/StationPanel.svelte';
let wasmError = $state('');
@@ -14,7 +15,6 @@
await initWasm();
simulation.bodyInfos = getBodyInfos();
simulation.wasmReady = true;
// Start in Jan 2025 for a recognizable view
simulation.setDate(2025, 1, 1);
simulation.isPlaying = true;
} catch (e) {
@@ -37,23 +37,30 @@
</header>
<!-- Main content -->
<main class="flex-1 relative overflow-hidden">
<main class="flex-1 flex overflow-hidden">
{#if wasmError}
<div class="absolute inset-0 flex items-center justify-center">
<div class="flex-1 flex items-center justify-center">
<div class="bg-red-900/50 border border-red-500/30 rounded-lg p-6 max-w-md">
<h2 class="text-red-400 font-bold mb-2">Failed to load simulation engine</h2>
<p class="text-sm text-red-300/80">{wasmError}</p>
</div>
</div>
{:else if !simulation.wasmReady}
<div class="absolute inset-0 flex items-center justify-center">
<div class="flex-1 flex items-center justify-center">
<div class="text-center">
<div class="w-8 h-8 border-2 border-[var(--accent-blue)] border-t-transparent rounded-full animate-spin mx-auto mb-3"></div>
<p class="text-sm text-[var(--text-secondary)]">Initializing simulation engine...</p>
</div>
</div>
{:else}
<Viewport />
<!-- Viewport -->
<div class="flex-1 relative">
<Viewport />
</div>
<!-- Right sidebar -->
<aside class="w-64 shrink-0 p-2 bg-[var(--bg-secondary)] border-l border-white/5 overflow-y-auto">
<StationPanel />
</aside>
{/if}
</main>