From b8af14c1ddce175cc7fa944f44e1b74645c80900 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 20 Mar 2024 20:51:22 +0100 Subject: [PATCH] spawn Juptiter through defs.txt --- src/defs.txt | 5 +++++ src/world.rs | 22 +--------------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/defs.txt b/src/defs.txt index 8af764d..cb3b538 100644 --- a/src/defs.txt +++ b/src/defs.txt @@ -5,6 +5,11 @@ actor -50 0 0 "icarus" chatid "hi_icarus" scale 1 +actor 300000 0 500000 "jupiter" + scale 80000 + rotationy -1.40 + angularmomentum 0 0.0001 0 + chat "hialien" name "Alien" msg 0 "INIT" "EXIT" "Leave me alone" diff --git a/src/world.rs b/src/world.rs index 290a896..f015293 100644 --- a/src/world.rs +++ b/src/world.rs @@ -9,7 +9,6 @@ use bevy::pbr::CascadeShadowConfigBuilder; use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings}; use std::f32::consts::PI; -const JUPITER_SIZE: f32 = 80000.0; const ASTEROID_SIZE: f32 = 100.0; const MOON_SIZE: f32 = 200.0; const MARS_SIZE: f32 = 10.0; @@ -29,6 +28,7 @@ const ASSET_JUPITER: &str = "models/jupiter.glb#Scene0"; fn asset_name_to_path(name: &str) -> &'static str { match name { "astronaut" => ASSET_ASTRONAUT, + "jupiter" => ASSET_JUPITER, _ => ASSET_ASTRONAUT, } } @@ -278,26 +278,6 @@ pub fn setup( }, )); - commands.spawn(( - actor::Actor { - angular_momentum: Quat::from_euler(EulerRot::XYZ, 0.0, 0.0001, 0.0), - ..default() - }, - SceneBundle { - transform: Transform { - translation: Vec3::new( - 300000.0, - 0.0, - 500000.0, - ), - rotation: Quat::from_rotation_y(PI * -1.40), - scale: Vec3::splat(JUPITER_SIZE), - }, - scene: asset_server.load(ASSET_JUPITER), - ..default() - }, - )); - // Add Light from the Sun commands.spawn(DirectionalLightBundle { directional_light: DirectionalLight {