From b0af8dbeae571d5b833530378c5dd6b6892cbcf5 Mon Sep 17 00:00:00 2001 From: ghostlyzsh Date: Sun, 7 Jan 2024 21:46:58 -0600 Subject: [PATCH] mars is outside of moon --- server/src/main.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index d86157d93da25eb3abd5a0d005f1ac732e903ceb..3a3452c473e4fee8e2962de8a720f5a22fe3dd70 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -141,7 +141,7 @@ fn spawn_planets(mut commands: Commands) { .insert(Sensor); }) .insert(RigidBody::Fixed); - let mars_pos = Transform::from_xyz(3000.0 / SCALE, 700.0 / SCALE, 0.0); + let mars_pos = Transform::from_xyz(3000.0 / SCALE, 900.0 / SCALE, 0.0); commands .spawn(PlanetBundle { planet_type: PlanetType::Mars, @@ -1003,18 +1003,17 @@ fn load_savefile( angle_offset = -PI / 2.; } - let transform = - Transform::from_xyz( - p_pos.x + offset.x / SCALE * angle.cos() - offset.y / SCALE * angle.sin(), - p_pos.y + offset.x / SCALE * angle.sin() + offset.y / SCALE * angle.cos(), - 0., - ) - .with_rotation(Quat::from_euler( - EulerRot::ZYX, - angle + angle_offset, - 0., - 0., - )); + let transform = Transform::from_xyz( + p_pos.x + offset.x / SCALE * angle.cos() - offset.y / SCALE * angle.sin(), + p_pos.y + offset.x / SCALE * angle.sin() + offset.y / SCALE * angle.cos(), + 0., + ) + .with_rotation(Quat::from_euler( + EulerRot::ZYX, + angle + angle_offset, + 0., + 0., + )); let module_id = { let module = commands.spawn(PartBundle { transform: TransformBundle::from(transform),