~starkingdoms/starkingdoms

b0af8dbeae571d5b833530378c5dd6b6892cbcf5 — ghostlyzsh 1 year, 11 months ago 9cfacea
mars is outside of moon
1 files changed, 12 insertions(+), 13 deletions(-)

M server/src/main.rs
M server/src/main.rs => server/src/main.rs +12 -13
@@ 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),