diff --git a/Cargo.lock b/Cargo.lock index 87e7a5a..09ae1af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2038,6 +2038,7 @@ dependencies = [ "bytemuck", "byteorder", "color_quant", + "jpeg-decoder", "num-traits", "png", ] @@ -2134,6 +2135,12 @@ dependencies = [ "libc", ] +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + [[package]] name = "js-sys" version = "0.3.69" @@ -2315,6 +2322,26 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "minimp3-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e21c73734c69dc95696c9ed8926a2b393171d98b3f5f5935686a26a487ab9b90" +dependencies = [ + "cc", +] + +[[package]] +name = "minimp3_fixed" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b0f14e7e75da97ae396c2656b10262a3d4afa2ec98f35795630eff0c8b951b" +dependencies = [ + "minimp3-sys", + "slice-ring-buffer", + "thiserror", +] + [[package]] name = "miniz_oxide" version = "0.7.2" @@ -2900,6 +2927,7 @@ checksum = "3b1bb7b48ee48471f55da122c0044fcc7600cfcc85db88240b89cb832935e611" dependencies = [ "cpal", "lewton", + "minimp3_fixed", ] [[package]] @@ -3026,6 +3054,17 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-ring-buffer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7081c7e452cb62f5f0c32edd4e265391bdbb23e90905df8bb88a23d3b5166b77" +dependencies = [ + "libc", + "mach2", + "winapi", +] + [[package]] name = "slotmap" version = "1.0.7" diff --git a/Cargo.toml b/Cargo.toml index 43d3a02..ad91adc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { version = "0.13.0", features = ["dynamic_linking"] } -#bevy = "0.13.0" +bevy = { version = "0.13.0", features = ["jpeg", "minimp3", "dynamic_linking"] } +#bevy = { version = "0.13.0", features = ["jpeg", "minimp3"] } # Enable a small amount of optimization in debug mode [profile.dev] diff --git a/assets/models/jupiter.blend b/assets/models/jupiter.blend new file mode 100644 index 0000000..d74c6ce Binary files /dev/null and b/assets/models/jupiter.blend differ diff --git a/assets/models/jupiter.glb b/assets/models/jupiter.glb new file mode 100644 index 0000000..d16eb84 Binary files /dev/null and b/assets/models/jupiter.glb differ diff --git a/src/world.rs b/src/world.rs index 18ce81b..a8fef4f 100644 --- a/src/world.rs +++ b/src/world.rs @@ -7,6 +7,7 @@ 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; @@ -22,6 +23,7 @@ const ASSET_ASTRONAUT: &str = "external/alien.glb#Scene0"; const ASSET_ASTEROID1: &str = "models/asteroid.glb#Scene0"; const ASSET_ASTEROID2: &str = "models/asteroid2.glb#Scene0"; const ASSET_PIZZERIA: &str = "models/pizzeria.glb#Scene0"; +const ASSET_JUPITER: &str = "models/jupiter.glb#Scene0"; pub struct WorldPlugin; impl Plugin for WorldPlugin { @@ -269,6 +271,26 @@ 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 * 0.0), + scale: Vec3::splat(JUPITER_SIZE), + }, + scene: asset_server.load(ASSET_JUPITER), + ..default() + }, + )); + // Space is DARK ambient_light.brightness = 0.0;