mark solar system planets (and pluto) the same way as moons

This commit is contained in:
yuni 2024-05-01 17:55:05 +02:00
parent 90e4f36fff
commit 2cb9f10f4b
3 changed files with 88 additions and 54 deletions

View file

@ -289,6 +289,9 @@ pub fn load_defs(
["moon", "yes"] => { ["moon", "yes"] => {
state.is_moon = true; state.is_moon = true;
} }
["planet", "yes"] => {
state.is_moon = true;
}
["sun", "yes"] => { ["sun", "yes"] => {
state.is_sun = true; state.is_sun = true;
} }
@ -541,6 +544,7 @@ fn spawn_entities(
if let Some(id) = &state.orbit_object_id { if let Some(id) = &state.orbit_object_id {
let mass = match id.as_str() { let mass = match id.as_str() {
"jupiter" => nature::JUPITER_MASS, "jupiter" => nature::JUPITER_MASS,
"sol" => nature::JUPITER_MASS,
_ => { _ => {
error!("Found no mass for object `{id}`"); error!("Found no mass for object `{id}`");
continue; continue;
@ -548,7 +552,8 @@ fn spawn_entities(
}; };
let orbital_period = nature::simple_orbital_period(mass, r); let orbital_period = nature::simple_orbital_period(mass, r);
phase_radians += if let Ok(epoch) = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) { phase_radians += if let Ok(epoch) = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) {
PI64 * 2.0 * (epoch.as_secs_f64() % orbital_period) / orbital_period let now = epoch.as_secs_f64() + 614533234154.0; // random
PI64 * 2.0 * (now % orbital_period) / orbital_period
} else { } else {
error!("Can't determine current time `{id}`"); error!("Can't determine current time `{id}`");
0.0 0.0

View file

@ -5,59 +5,86 @@ actor 0 0 0
sphere yes sphere yes
sun yes sun yes
physics off physics off
actor 0 0 0 orbitring actor 0 0 0
scale 57.91e9 planet yes
rotationz 0.0353 orbitaround sol 57.91e9
only_in_map_at_dist 1e10 jupiter actor 0 0 0 orbitring
clickable no scale 57.91e9
physics off rotationz 0.0353
actor 0 0 0 orbitring only_in_map_at_dist 1e10 jupiter
scale 108.21e9 clickable no
rotationz 0.0119 physics off
only_in_map_at_dist 1e10 jupiter actor 0 0 0
clickable no planet yes
physics off orbitaround sol 108.21e9
actor 0 0 0 orbitring actor 0 0 0 orbitring
scale 149.598023e9 scale 108.21e9
rotationz 0.0088 rotationz 0.0119
only_in_map_at_dist 1e10 jupiter only_in_map_at_dist 1e10 jupiter
clickable no clickable no
physics off physics off
actor 0 0 0 orbitring actor 0 0 0
scale 227.939366e9 planet yes
rotationz 0.0091 orbitaround sol 149.598023e9
only_in_map_at_dist 1e10 jupiter actor 0 0 0 orbitring
clickable no scale 149.598023e9
physics off rotationz 0.0088
actor 0 0 0 orbitring only_in_map_at_dist 1e10 jupiter
scale 778.479e9 clickable no
only_in_map_at_dist 1e10 jupiter physics off
clickable no actor 0 0 0
physics off planet yes
actor 0 0 0 orbitring orbitaround sol 227.939366e9
scale 1433.53e9 actor 0 0 0 orbitring
rotationz 0.0052 scale 227.939366e9
only_in_map_at_dist 1e10 jupiter rotationz 0.0091
clickable no only_in_map_at_dist 1e10 jupiter
physics off clickable no
actor 0 0 0 orbitring physics off
scale 2870.972e9 actor 0 0 0
rotationz 0.0055 planet yes
only_in_map_at_dist 1e10 jupiter orbitaround sol 778.479e9
clickable no actor 0 0 0 orbitring
physics off scale 778.479e9
actor 0 0 0 orbitring only_in_map_at_dist 1e10 jupiter
scale 4500e9 clickable no
rotationz 0.0041 physics off
only_in_map_at_dist 1e10 jupiter actor 0 0 0
clickable no planet yes
physics off orbitaround sol 1433.53e9
actor 0 0 0 orbitring actor 0 0 0 orbitring
scale 5906.38e9 scale 1433.53e9
rotationz 0.0953 rotationz 0.0052
only_in_map_at_dist 1e10 jupiter only_in_map_at_dist 1e10 jupiter
clickable no clickable no
physics off physics off
actor 0 0 0
planet yes
orbitaround sol 2870.972e9
actor 0 0 0 orbitring
scale 2870.972e9
rotationz 0.0055
only_in_map_at_dist 1e10 jupiter
clickable no
physics off
actor 0 0 0
planet yes
orbitaround sol 4500e9
actor 0 0 0 orbitring
scale 4500e9
rotationz 0.0041
only_in_map_at_dist 1e10 jupiter
clickable no
physics off
actor 0 0 0
planet yes
orbitaround sol 5906.38e9
actor 0 0 0 orbitring
scale 5906.38e9
rotationz 0.0953
only_in_map_at_dist 1e10 jupiter
clickable no
physics off
actor 0 0 0 jupiter actor 0 0 0 jupiter
relativeto sol relativeto sol

View file

@ -28,6 +28,8 @@ pub const G: f64 = 6.6743015e-11; // Gravitational constant in Nm²/kg²
pub const SOL_RADIUS: f64 = 696_300_000.0; pub const SOL_RADIUS: f64 = 696_300_000.0;
pub const JUPITER_RADIUS: f64 = 71_492_000.0; pub const JUPITER_RADIUS: f64 = 71_492_000.0;
pub const JUPITER_RING_RADIUS: f64 = 229_000_000.0; pub const JUPITER_RING_RADIUS: f64 = 229_000_000.0;
pub const SOL_MASS: f64 = 1.9885e30;
pub const JUPITER_MASS: f64 = 1.8982e27; pub const JUPITER_MASS: f64 = 1.8982e27;
// Each star's values: (x, y, z, magnitude, color index, distance, name) // Each star's values: (x, y, z, magnitude, color index, distance, name)