spawn Juptiter through defs.txt

This commit is contained in:
yuni 2024-03-20 20:51:22 +01:00
parent 8736397cbf
commit b8af14c1dd
2 changed files with 6 additions and 21 deletions

View file

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

View file

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