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