From 2ae05214f69a93d705db8bdc178c6d5ffc388714 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 8 Apr 2024 04:17:45 +0200 Subject: [PATCH] normalize planet sizes, make jupiter clickable --- src/commands.rs | 12 +----------- src/defs.txt | 11 +++++------ 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 6c384a5..4a9980c 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -297,16 +297,6 @@ 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); @@ -595,7 +585,7 @@ fn spawn_entities( actor.insert(Rotation::from(state.rotation)); if state.is_sphere { let sphere_texture_handle: Handle = asset_server.load(format!("textures/{}.jpg", state.model)); - let sphere_handle = meshes.add(Sphere::default().mesh().uv(128, 128)); + let sphere_handle = meshes.add(Sphere::new(1.0).mesh().uv(128, 128)); let sphere_material_handle = materials.add(StandardMaterial { base_color_texture: Some(sphere_texture_handle.clone()), perceptual_roughness: 1.0, diff --git a/src/defs.txt b/src/defs.txt index 797b4b1..f5a7762 100644 --- a/src/defs.txt +++ b/src/defs.txt @@ -1,13 +1,12 @@ actor 0 0 0 jupiter id jupiter name Jupiter - radius 71492e3 + scale 71492e3 sphere yes physics off rotationx -0.50 rotationz -0.28 angularmomentum 30 30 30 - clickable no actor 0 593051 0 suit relativeto jupiter @@ -40,7 +39,7 @@ actor 0 0 0 io name Io relativeto jupiter orbit 421700e3 0.65 - radius 1822e3 + scale 1822e3 rotationy -0.40 angularmomentum 0 0.0001 0 sphere yes @@ -51,7 +50,7 @@ actor 0 0 0 europa name Europa relativeto jupiter orbit 670900e3 0.35 - radius 1561e3 + scale 1561e3 rotationy 0.20 angularmomentum 0 0.0001 0 sphere yes @@ -62,7 +61,7 @@ actor 0 0 0 ganymede name Ganymede relativeto jupiter orbit 1070400e3 0.93 - radius 2634e3 + scale 2634e3 rotationy -0.40 angularmomentum 0 0.0001 0 sphere yes @@ -73,7 +72,7 @@ actor 0 0 0 callisto name Callisto relativeto jupiter orbit 1882700e3 0.45 - radius 2410e3 + scale 2410e3 rotationy -0.40 angularmomentum 0 0.0001 0 sphere yes