===JUPITER===

This commit is contained in:
yuni 2024-03-19 22:16:30 +01:00
parent 8bfe15d3d4
commit 810ad8c563
5 changed files with 63 additions and 2 deletions

39
Cargo.lock generated
View file

@ -2038,6 +2038,7 @@ dependencies = [
"bytemuck", "bytemuck",
"byteorder", "byteorder",
"color_quant", "color_quant",
"jpeg-decoder",
"num-traits", "num-traits",
"png", "png",
] ]
@ -2134,6 +2135,12 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "jpeg-decoder"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0"
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.69" version = "0.3.69"
@ -2315,6 +2322,26 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 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]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.7.2" version = "0.7.2"
@ -2900,6 +2927,7 @@ checksum = "3b1bb7b48ee48471f55da122c0044fcc7600cfcc85db88240b89cb832935e611"
dependencies = [ dependencies = [
"cpal", "cpal",
"lewton", "lewton",
"minimp3_fixed",
] ]
[[package]] [[package]]
@ -3026,6 +3054,17 @@ dependencies = [
"autocfg", "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]] [[package]]
name = "slotmap" name = "slotmap"
version = "1.0.7" version = "1.0.7"

View file

@ -6,8 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
bevy = { version = "0.13.0", features = ["dynamic_linking"] } bevy = { version = "0.13.0", features = ["jpeg", "minimp3", "dynamic_linking"] }
#bevy = "0.13.0" #bevy = { version = "0.13.0", features = ["jpeg", "minimp3"] }
# Enable a small amount of optimization in debug mode # Enable a small amount of optimization in debug mode
[profile.dev] [profile.dev]

BIN
assets/models/jupiter.blend Normal file

Binary file not shown.

BIN
assets/models/jupiter.glb Normal file

Binary file not shown.

View file

@ -7,6 +7,7 @@ use bevy::pbr::CascadeShadowConfigBuilder;
use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings}; use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings};
use std::f32::consts::PI; use std::f32::consts::PI;
const JUPITER_SIZE: f32 = 80000.0;
const ASTEROID_SIZE: f32 = 100.0; const ASTEROID_SIZE: f32 = 100.0;
const MOON_SIZE: f32 = 200.0; const MOON_SIZE: f32 = 200.0;
const MARS_SIZE: f32 = 10.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_ASTEROID1: &str = "models/asteroid.glb#Scene0";
const ASSET_ASTEROID2: &str = "models/asteroid2.glb#Scene0"; const ASSET_ASTEROID2: &str = "models/asteroid2.glb#Scene0";
const ASSET_PIZZERIA: &str = "models/pizzeria.glb#Scene0"; const ASSET_PIZZERIA: &str = "models/pizzeria.glb#Scene0";
const ASSET_JUPITER: &str = "models/jupiter.glb#Scene0";
pub struct WorldPlugin; pub struct WorldPlugin;
impl Plugin for 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 // Space is DARK
ambient_light.brightness = 0.0; ambient_light.brightness = 0.0;