This commit is contained in:
Leon Liu 2025-08-15 10:31:40 +09:00
parent 1a97b9e986
commit 07ccac9c2a

View File

@ -317,8 +317,6 @@ fn manage_label_overlaps(
for (label, mut visible) in label_query.iter_mut() {
if label.target_entity == entity_to_hide {
visible.0 = false;
// Debug: which label got hidden
debug!("Hiding label due to overlap (distance: {:.1}px)", distance);
break;
}
}
@ -562,16 +560,15 @@ fn setup_solar_system(mut commands: Commands) {
}
// High precision constants
const G_SI: f64 = 6.67430e-11; // m^3 / (kg s^2)
const AU_TO_M: f64 = 149_597_870_691.0; // m
const DAY_TO_S: f64 = 86_400.0; // s
const SOLAR_MASS_KG: f64 = 1.98841e30; // kg
const SOLAR_MASS_KG: f64 = 1.98841e30; // kg (for mass conversion)
// Gaussian gravitational constant (standard in astronomy)
const K_GAUSS: f64 = 0.01720209895; // AU^(3/2) / (solar_mass^(1/2) × day)
// G in AU^3 / (solar_mass day^2)
// G_SI has units m^3 / (kg s^2)
// We want AU^3 / (solar_mass day^2)
// G_AU = G_SI * (day^2 / s^2) * (kg / solar_mass) * (m^3 / AU^3)
const G_AU: f64 = G_SI * (DAY_TO_S * DAY_TO_S) / (SOLAR_MASS_KG * AU_TO_M * AU_TO_M * AU_TO_M);
// Derived from Gaussian constant: G_AU = k² where k is the Gaussian constant
// This gives G×M_sun in AU³/day² units, and since we use solar mass units (M_sun = 1), G_AU = k²
const G_AU: f64 = K_GAUSS * K_GAUSS;
const STEPS: usize = 100;
// If FixedUpdate is 64 Hz and you want 1 day per game second: DT = 1/(64*STEPS) day/step