From 1292c16faa29f5dae2c087e68da2b1ed436ca0c7 Mon Sep 17 00:00:00 2001 From: core Date: Thu, 27 Nov 2025 22:04:34 -0500 Subject: [PATCH] feat: add orbital info to config --- crates/unified/assets/config/planets.pc.toml | 10 ++++++++++ crates/unified/src/config/planet.rs | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/unified/assets/config/planets.pc.toml b/crates/unified/assets/config/planets.pc.toml index a170ab390b64e923a55462780ff5a7afd147a66f..2e2626e31a202b891b3003fefb9f06915393342e 100644 --- a/crates/unified/assets/config/planets.pc.toml +++ b/crates/unified/assets/config/planets.pc.toml @@ -12,6 +12,7 @@ sprite = "textures/mercury.png" radius = 333.33 # m mass = 205_000_000.0 # kg default_transform = [116_129.4, 0.0, 0.0] +orbit = { orbiting = "Sun", eccentricity = 0.2056 } [[planets]] name = "Venus" @@ -19,6 +20,7 @@ sprite = "textures/venus.png" radius = 949.9 # m mass = 806_166_000.0 # kg default_transform = [216_999.6, 0.0, 0.0] +orbit = { orbiting = "Sun", eccentricity = 0.0068 } [[planets]] name = "Earth" @@ -27,6 +29,7 @@ indicator_sprite = "textures/earth_icon.png" radius = 1000.0 # m mass = 4_900_000_000.0 # kg default_transform = [300_000.0, 0.0, 0.0] +orbit = { orbiting = "Sun", eccentricity = 0.0167 } [[planets]] name = "Moon" @@ -35,6 +38,7 @@ indicator_sprite = "textures/moon_icon.png" radius = 272.7 # m mass = 60_236_000.0 # kg default_transform = [305_700.0, 0.0, 0.0] +orbit = { orbiting = "Earth", eccentricity = 0.0549 } [[planets]] name = "Mars" @@ -43,6 +47,7 @@ indicator_sprite = "textures/mars_icon.png" radius = 531.0 # m mass = 525_857_000.0 # kg default_transform = [430_000.0, 0.0, 0.0] +orbit = { orbiting = "Sun", eccentricity = 0.0934 } [[planets]] name = "Jupiter" @@ -50,6 +55,7 @@ sprite = "textures/jupiter.png" radius = 10973.0 # m mass = 1_131_221_218_000.0 # kg default_transform = [1_561_140.0, 0.0, 0.0] +orbit = { orbiting = "Sun", eccentricity = 0.0484 } [[planets]] name = "Saturn" @@ -57,6 +63,7 @@ sprite = "textures/earth.png" radius = 9_140.2 # m mass = 561_386_112_000.0 # kg default_transform = [2_874_780.0, 0.0, 0.0] +orbit = { orbiting = "Sun", eccentricity = 0.0541 } [[planets]] name = "Uranus" @@ -64,6 +71,7 @@ sprite = "textures/venus.png" radius = 4007.0 # m mass = 69_763_532_000.0 # kg default_transform = [4_050_000.0, 0.0, 0.0] +orbit = { orbiting = "Sun", eccentricity = 0.0472 } [[planets]] name = "Neptune" @@ -71,6 +79,7 @@ sprite = "textures/mars.png" radius = 3_883.0 # m mass = 106_674_649_000.0 # kg default_transform = [5_000_000.0, 0.0, 0.0] +orbit = { orbiting = "Sun", eccentricity = 0.0086 } [[planets]] name = "Pluto" @@ -78,3 +87,4 @@ sprite = "textures/jupiter.png" radius = 186.8 # m mass = 10_817_000.0 # kg default_transform = [5_922_300.0, 0.0, 0.0] +orbit = { orbiting = "Sun", eccentricity = 0.2488 } \ No newline at end of file diff --git a/crates/unified/src/config/planet.rs b/crates/unified/src/config/planet.rs index e875de0db50c2a13943de8c3aeaadf58ff2b8d8e..1aca4702fa34afa72c72f79f4843b8ce07d9a168 100644 --- a/crates/unified/src/config/planet.rs +++ b/crates/unified/src/config/planet.rs @@ -17,6 +17,13 @@ pub struct Planet { pub mass: f32, pub default_transform: [f32; 3], pub special_sprite_properties: Option, + pub orbit: Option +} + +#[derive(Deserialize, TypePath, Serialize, Clone, Debug)] +pub struct OrbitData { + pub orbiting: String, + pub eccentricity: f32, } #[derive(Deserialize, TypePath, Serialize, Clone, Debug)] @@ -30,7 +37,6 @@ pub struct PlanetBundle { pub transform: Transform, pub collider: Collider, pub mass: Mass - //pub additional_mass_properties: AdditionalMassProperties, } #[derive(Deserialize, Asset, TypePath)]