Stage 0. Zero-dependency serve.py (static + allowlisted horizons/sbdb/cad proxy, sha256 disk cache with past-span immutability). Three.js via pinned importmap, logarithmic depth, procedural starfield sky (+ Milky Way panorama swap-in), Sun with additive glow, OrbitControls, brass-and-void HUD, scrubbable time bar, central bodyWorld position pass, focus/camera system, hash state. Boots clean, no console errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
76 lines
2.2 KiB
JavaScript
76 lines
2.2 KiB
JavaScript
// SOLARGOD configuration — every scale constant, camera default, rate preset and
|
||
// tunable in one place. Feed paths are RELATIVE so the app works at "/" (dev) and
|
||
// under a subpath (prod). Never introduce a leading-slash path.
|
||
|
||
export const CONFIG = {
|
||
proxy: {
|
||
horizons: 'proxy/horizons',
|
||
sbdb: 'proxy/sbdb',
|
||
cad: 'proxy/cad',
|
||
},
|
||
|
||
// Clock validity = Table 1 range. Scrubbing clamps here (brief §2).
|
||
time: {
|
||
minMs: Date.UTC(1800, 0, 1),
|
||
maxMs: Date.UTC(2050, 0, 1),
|
||
liveThresholdSec: 60, // |sim − wall| ≤ 60 s at 1× → LIVE
|
||
},
|
||
|
||
// The view transform (scale.js). r_view = K · r_AU^P, with P animating between
|
||
// P_mega (0.4) and P_true (1.0). K stays constant so only P moves (brief §4).
|
||
scale: {
|
||
K: 9.0,
|
||
P_mega: 0.4,
|
||
P_true: 1.0,
|
||
transitionMs: 2500,
|
||
// Body draw radius = (r_km / AU_KM) · K · E. Sun gets its own E or it swallows
|
||
// Mercury. HUD slider swaps planetE between presets.
|
||
planetE: 1200,
|
||
sunE: 60,
|
||
ePresets: [1, 100, 1200],
|
||
// Moon local compression around parent (MEGA):
|
||
// d_view = R_parent_draw · (base + k · log10(1 + d_km / R_parent_km)).
|
||
moonBase: 1.8,
|
||
moonK: 1.2,
|
||
},
|
||
|
||
camera: {
|
||
fov: 55,
|
||
near: 0.001,
|
||
far: 1e12,
|
||
focusDistanceFactor: 6, // settle at ~6× target draw radius
|
||
flightMs: 2000,
|
||
startFocus: 'sun',
|
||
minDistance: 0.02,
|
||
},
|
||
|
||
// Rate presets in sim-seconds per wall-second (magnitude; sign via reverse btn).
|
||
rates: [
|
||
{ label: '1×', value: 1 },
|
||
{ label: '1 min/s', value: 60 },
|
||
{ label: '1 hr/s', value: 3600 },
|
||
{ label: '1 day/s', value: 86400 },
|
||
{ label: '1 wk/s', value: 604800 },
|
||
{ label: '1 mo/s', value: 2629800 }, // 30.4375 d
|
||
{ label: '1 yr/s', value: 31557600 }, // 365.25 d
|
||
],
|
||
defaultRateIndex: 3, // 1 day/s
|
||
|
||
textures: {
|
||
path: 'assets/textures/',
|
||
skybox: '2k_stars_milky_way.jpg',
|
||
},
|
||
|
||
// Orbit paths rebuild only when |ΔT| exceeds this (centuries) or scale changes.
|
||
orbitRebuildCy: 0.1,
|
||
orbitSamples: 512,
|
||
|
||
useExtendedRange: false, // Table 2a swap — plumbing only, no v1 UI
|
||
|
||
colors: {
|
||
accent: '#d9a441', // brass
|
||
orbit: 0x3a4a63,
|
||
orbitFocus: 0xd9a441,
|
||
},
|
||
};
|