normalize planet sizes, make jupiter clickable

This commit is contained in:
yuni 2024-04-08 04:17:45 +02:00
parent 3ed8a9b8b0
commit 2ae05214f6
2 changed files with 6 additions and 17 deletions

View file

@ -297,16 +297,6 @@ pub fn load_defs(
continue;
}
}
["radius", radius] => {
// like scale, just doubled size
if let Ok(radius_float) = radius.parse::<f32>() {
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::<f32>() {
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<Image> = 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,

View file

@ -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