Compare commits
6 commits
2873894003
...
131a49b7f9
Author | SHA1 | Date | |
---|---|---|---|
yuni | 131a49b7f9 | ||
yuni | 0397992d6d | ||
yuni | 4d19495ab5 | ||
yuni | b5105ff4c5 | ||
yuni | 4af88bab15 | ||
yuni | bfc5e2666a |
2
Cargo.lock
generated
|
@ -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",
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
{
|
{
|
||||||
"mimeType":"image/jpeg",
|
"mimeType":"image/jpeg",
|
||||||
"name":"mercury",
|
"name":"mercury",
|
||||||
"uri":"../textures/mercury.jpg"
|
"uri":"textures/mercury.jpg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"accessors":[
|
"accessors":[
|
||||||
|
|
|
@ -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":[
|
||||||
|
|
|
@ -299,7 +299,7 @@
|
||||||
{
|
{
|
||||||
"mimeType":"image/jpeg",
|
"mimeType":"image/jpeg",
|
||||||
"name":"solarpanel",
|
"name":"solarpanel",
|
||||||
"uri":"../textures/solarpanel.jpg"
|
"uri":"textures/solarpanel.jpg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"accessors":[
|
"accessors":[
|
||||||
|
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 770 KiB After Width: | Height: | Size: 770 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
Before Width: | Height: | Size: 2 MiB After Width: | Height: | Size: 2 MiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 332 KiB After Width: | Height: | Size: 332 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
@ -84,7 +84,7 @@
|
||||||
{
|
{
|
||||||
"mimeType":"image/jpeg",
|
"mimeType":"image/jpeg",
|
||||||
"name":"mercury",
|
"name":"mercury",
|
||||||
"uri":"../textures/mercury.jpg"
|
"uri":"textures/mercury.jpg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"accessors":[
|
"accessors":[
|
||||||
|
|
29
src/actor.rs
|
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
};
|
};
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|