From 8b7ccc1b582195c88d26f8bde1434d6db905f49f Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 2 Apr 2024 01:14:05 +0200 Subject: [PATCH] fix planet/moon sizes --- src/commands.rs | 12 +++++++++++- src/defs.txt | 10 +++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 3f49f8f..951acd4 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -258,7 +258,7 @@ pub fn load_defs( state.is_vehicle = true; } ["moon", "yes"] => { - state.model_scale *= 6.0; + state.model_scale *= 3.0; } ["oxygen", amount] => { if let Ok(amount) = amount.parse::() { @@ -286,6 +286,16 @@ pub fn load_defs( continue; } } + ["radius", radius] => { + // like scale, just doubled size + if let Ok(radius_float) = radius.parse::() { + state.model_scale = 2.0 * radius_float; + } + else { + error!("Can't parse float: {line}"); + continue; + } + } ["rotationx", rotation_x] => { if let Ok(rotation_x_float) = rotation_x.parse::() { state.rotation *= Quat::from_rotation_x(PI * rotation_x_float); diff --git a/src/defs.txt b/src/defs.txt index 9801b14..b2be528 100644 --- a/src/defs.txt +++ b/src/defs.txt @@ -1,6 +1,6 @@ actor 0 0 0 jupiter id jupiter - scale 71492e3 + radius 71492e3 sphere yes physics off rotationx -0.50 @@ -36,7 +36,7 @@ actor 10 -30 20 MeteorAceGT actor 0 0 0 io relativeto jupiter orbit 421700e3 0.75 - scale 1822e3 + radius 1822e3 rotationy -0.40 angularmomentum 0 0.0001 0 sphere yes @@ -46,7 +46,7 @@ actor 0 0 0 io actor 0 0 0 europa relativeto jupiter orbit 670900e3 0.35 - scale 1561e3 + radius 1561e3 rotationy 0.20 angularmomentum 0 0.0001 0 sphere yes @@ -56,7 +56,7 @@ actor 0 0 0 europa actor 0 0 0 ganymede relativeto jupiter orbit 1070400e3 0.93 - scale 2634e3 + radius 2634e3 rotationy -0.40 angularmomentum 0 0.0001 0 sphere yes @@ -66,7 +66,7 @@ actor 0 0 0 ganymede actor 0 0 0 callisto relativeto jupiter orbit 1882700e3 0.45 - scale 2410e3 + radius 2410e3 rotationy -0.40 angularmomentum 0 0.0001 0 sphere yes