Compare commits

..

6 commits

27 changed files with 53 additions and 23 deletions

2
Cargo.lock generated
View file

@ -3039,7 +3039,7 @@ dependencies = [
[[package]] [[package]]
name = "outfly" name = "outfly"
version = "0.12.0-dev" version = "0.12.0"
dependencies = [ dependencies = [
"bevy", "bevy",
"bevy_embedded_assets", "bevy_embedded_assets",

View file

@ -10,7 +10,7 @@
[package] [package]
name = "outfly" name = "outfly"
version = "0.12.0-dev" version = "0.12.0"
edition = "2021" edition = "2021"
homepage = "https://codeberg.org/outfly/outfly" homepage = "https://codeberg.org/outfly/outfly"
repository = "https://codeberg.org/outfly/outfly" repository = "https://codeberg.org/outfly/outfly"

View file

@ -75,7 +75,7 @@
{ {
"mimeType":"image/jpeg", "mimeType":"image/jpeg",
"name":"mercury", "name":"mercury",
"uri":"../textures/mercury.jpg" "uri":"textures/mercury.jpg"
} }
], ],
"accessors":[ "accessors":[

View file

@ -1936,22 +1936,22 @@
{ {
"mimeType":"image/jpeg", "mimeType":"image/jpeg",
"name":"mercury", "name":"mercury",
"uri":"../textures/mercury.jpg" "uri":"textures/mercury.jpg"
}, },
{ {
"mimeType":"image/jpeg", "mimeType":"image/jpeg",
"name":"solarpanel", "name":"solarpanel",
"uri":"../textures/solarpanel.jpg" "uri":"textures/solarpanel.jpg"
}, },
{ {
"mimeType":"image/jpeg", "mimeType":"image/jpeg",
"name":"metal", "name":"metal",
"uri":"../textures/metal.jpg" "uri":"textures/metal.jpg"
}, },
{ {
"mimeType":"image/jpeg", "mimeType":"image/jpeg",
"name":"plant", "name":"plant",
"uri":"../textures/plant.jpg" "uri":"textures/plant.jpg"
} }
], ],
"accessors":[ "accessors":[

View file

@ -299,7 +299,7 @@
{ {
"mimeType":"image/jpeg", "mimeType":"image/jpeg",
"name":"solarpanel", "name":"solarpanel",
"uri":"../textures/solarpanel.jpg" "uri":"textures/solarpanel.jpg"
} }
], ],
"accessors":[ "accessors":[

View file

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View file

Before

Width:  |  Height:  |  Size: 770 KiB

After

Width:  |  Height:  |  Size: 770 KiB

View file

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View file

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View file

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View file

Before

Width:  |  Height:  |  Size: 2 MiB

After

Width:  |  Height:  |  Size: 2 MiB

View file

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View file

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 180 KiB

View file

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View file

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View file

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View file

Before

Width:  |  Height:  |  Size: 332 KiB

After

Width:  |  Height:  |  Size: 332 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -84,7 +84,7 @@
{ {
"mimeType":"image/jpeg", "mimeType":"image/jpeg",
"name":"mercury", "name":"mercury",
"uri":"../textures/mercury.jpg" "uri":"textures/mercury.jpg"
} }
], ],
"accessors":[ "accessors":[

View file

@ -696,7 +696,16 @@ fn handle_wants_maxvelocity(
} }
fn handle_wants_lookat( fn handle_wants_lookat(
mut query: Query<(&Position, &mut Rotation, &WantsToLookAt), Without<Camera>>, mut query: Query<
(
&Position,
&mut Rotation,
&Transform,
&WantsToLookAt,
Option<&visual::IsEffect>,
),
Without<Camera>,
>,
q_playercam: Query<&Position, With<PlayerCamera>>, q_playercam: Query<&Position, With<PlayerCamera>>,
q_cam: Query<&Transform, With<Camera>>, q_cam: Query<&Transform, With<Camera>>,
id2pos: Res<game::Id2Pos>, id2pos: Res<game::Id2Pos>,
@ -713,7 +722,7 @@ fn handle_wants_lookat(
}; };
// TODO: use ExternalTorque rather than hard-resetting the rotation // TODO: use ExternalTorque rather than hard-resetting the rotation
for (pos, mut rot, target_id) in &mut query { for (pos, mut rot, trans, target_id, is_effect) in &mut query {
let target_pos: DVec3 = if target_id.0 == cmd::ID_SPECIAL_PLAYERCAM { let target_pos: DVec3 = if target_id.0 == cmd::ID_SPECIAL_PLAYERCAM {
cam_pos cam_pos
} else if let Some(target_pos) = id2pos.0.get(&target_id.0) { } else if let Some(target_pos) = id2pos.0.get(&target_id.0) {
@ -721,12 +730,16 @@ fn handle_wants_lookat(
} else { } else {
continue; continue;
}; };
//let up = if trans.translation.length_squared() > 1e-6 { let up = if is_effect.is_some() {
// trans.up() // trans.up() sometimes crashes with thruster particle effects
//} else { Dir3::Y
// Dir3::Y } else {
//}; if trans.translation.length_squared() > 1e-6 {
let up = Dir3::Y; // TODO: the above code seems to be buggy, this is a workaround trans.up()
} else {
Dir3::Y
}
};
rot.0 = look_at_quat(**pos, target_pos, up.as_dvec3()); rot.0 = look_at_quat(**pos, target_pos, up.as_dvec3());
} }
} }

View file

@ -908,7 +908,7 @@ fn spawn_entities(
actor.insert(Position::from(absolute_pos)); actor.insert(Position::from(absolute_pos));
if state.is_sphere { if state.is_sphere {
let sphere_texture_handle = if let Some(model) = &state.model { let sphere_texture_handle = if let Some(model) = &state.model {
Some(asset_server.load(format!("textures/{}.jpg", model))) Some(asset_server.load(format!("models/textures/{}.jpg", model)))
} else { } else {
None None
}; };

View file

@ -159,8 +159,16 @@ actor 0 0 0
orbitaround jupiter 221900e3 orbitaround jupiter 221900e3
collider handcrafted collider handcrafted
density 10000000000 density 10000000000
scale 3e3 scale 2e3
angularmomentum 0 0.03 0 angularmomentum 0.4 2.0 0.3
actor -40e3 0 90e3 metis
name Moonlet
relativeto jupiter
orbitaround jupiter 221900e3
collider handcrafted
density 10000000000
scale 4e3
angularmomentum 0.02 0.01 0.0
actor 0 0 0 io actor 0 0 0 io
name Io name Io
id io id io

View file

@ -467,7 +467,9 @@ pub struct Preferences {
pub third_person: bool, pub third_person: bool,
pub shadows_sun: bool, pub shadows_sun: bool,
pub avatar: usize, pub avatar: usize,
#[serde(default = "Preferences::default_light_amp")]
pub light_amp: usize, // 0-3 pub light_amp: usize, // 0-3
#[serde(default = "Preferences::default_flashlight_power")]
pub flashlight_power: usize, // 0-2 pub flashlight_power: usize, // 0-2
pub thruster_boost: usize, // 0-2 pub thruster_boost: usize, // 0-2
@ -476,6 +478,13 @@ pub struct Preferences {
} }
impl Preferences { impl Preferences {
pub fn default_light_amp() -> usize {
1
}
pub fn default_flashlight_power() -> usize {
2
}
pub fn get_fullscreen_mode(&self) -> WindowMode { pub fn get_fullscreen_mode(&self) -> WindowMode {
match self.fullscreen_mode.as_str() { match self.fullscreen_mode.as_str() {
"legacy" => WindowMode::Fullscreen, "legacy" => WindowMode::Fullscreen,

View file

@ -171,7 +171,7 @@ pub fn spawn_effects(
)); ));
} }
Effects::ThrusterParticle(pos, v) => { Effects::ThrusterParticle(pos, v) => {
let texture = asset_server.load("textures/exhaust.png"); let texture = asset_server.load("models/textures/exhaust.png");
commands.spawn(( commands.spawn((
IsEffect, IsEffect,
hud::ToggleableHudElement, hud::ToggleableHudElement,