Compare commits

..

No commits in common. "330da6c7fc989c86ded3bd8d3179796469c1b227" and "73410efc09dbf867f6479dc50c13969f35302001" have entirely different histories.

23 changed files with 198 additions and 713 deletions

23
Cargo.lock generated
View file

@ -304,25 +304,6 @@ dependencies = [
"bevy_ecs",
]
[[package]]
name = "bevy_animation"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e553d68bc937586010ed2194ac66b751bc6238cf622b3ed5a86f4e1581e94509"
dependencies = [
"bevy_app",
"bevy_asset",
"bevy_core",
"bevy_ecs",
"bevy_hierarchy",
"bevy_math",
"bevy_reflect",
"bevy_render",
"bevy_time",
"bevy_transform",
"bevy_utils",
]
[[package]]
name = "bevy_app"
version = "0.13.2"
@ -569,7 +550,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21ecf404295055deb7fe037495891bc135ca10d46bc5b6c55f9ab7b7ebc61d31"
dependencies = [
"base64",
"bevy_animation",
"bevy_app",
"bevy_asset",
"bevy_core",
@ -628,7 +608,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f58ec0ce77603df9474cde61f429126bfe06eb79094440e9141afb4217751c79"
dependencies = [
"bevy_a11y",
"bevy_animation",
"bevy_app",
"bevy_asset",
"bevy_audio",
@ -2758,7 +2737,7 @@ dependencies = [
[[package]]
name = "outfly"
version = "0.8.0"
version = "0.7.3"
dependencies = [
"bevy",
"bevy_embedded_assets",

View file

@ -10,7 +10,7 @@
[package]
name = "outfly"
version = "0.8.0"
version = "0.7.3"
edition = "2021"
homepage = "https://codeberg.org/hut/outfly"
repository = "https://codeberg.org/hut/outfly"
@ -22,7 +22,7 @@ build = "build/build.rs"
[dependencies]
regex = "1"
bevy = { version = "0.13.2", default-features = false, features = ["animation", "bevy_asset", "bevy_audio", "bevy_scene", "bevy_winit", "bevy_core_pipeline", "bevy_pbr", "bevy_gltf", "bevy_render", "bevy_text", "bevy_ui", "jpeg", "multi-threaded", "tonemapping_luts", "vorbis"]}
bevy = { version = "0.13.2", default-features = false, features = ["jpeg", "bevy_asset", "bevy_audio", "bevy_scene", "bevy_winit", "bevy_core_pipeline", "bevy_pbr", "bevy_gltf", "bevy_render", "bevy_text", "bevy_ui", "multi-threaded", "tonemapping_luts", "vorbis"]}
bevy_xpbd_3d = { version = "0.4.2", default-features = false, features = ["3d", "f64", "parry-f64", "parallel", "async-collider"] }
bevy_embedded_assets = { version = "0.10.2", optional = true }
fastrand = "2.0"

View file

@ -16,7 +16,7 @@ Links: [Code](https://codeberg.org/hut/outfly) • [itch.io](https://yunicode.it
# OutFly
OutFly is an atmospheric, open world, realistic 3D space game that throws you into the [Rings of Jupiter](https://en.wikipedia.org/wiki/Rings_of_Jupiter) with a self-sufficient sportswear space suit that will take you anywhere.
OutFly is an atmospheric, open world, 100% hard sci-fi 3D game that throws you into the [Rings of Jupiter](https://en.wikipedia.org/wiki/Rings_of_Jupiter) with a self-sufficient sportswear space suit that will take you anywhere.
Imagine a blend of [Fallout](https://en.wikipedia.org/wiki/Fallout_%28series%29) and [Outer Wilds](https://en.wikipedia.org/wiki/Outer_Wilds) with a splash of [Firefly](https://en.wikipedia.org/wiki/Firefly_%28TV_series%29), where you are free to explore the breathtaking expanse of the Jupiter system and discover what life could be like after hundreds of years of space colonization.
@ -26,10 +26,10 @@ This game aims to respect the player as much as possible. It doesn't waste your
# Features
- A beautiful, serene atmosphere with gorgeous views
- Racing vehicles, unique NPCs, cozy places, deadly environment
- Accurate, clickable star chart. Can you spot the constellations?
- Cross platform, free & open source forever!
- Open source forever
- Open world, realistic hard sci-fi, atmospheric, deadly
- Accurate star chart. Can you spot the constellations?
- Cross platform (verified on Linux & Windows)
- Written in [Rust](https://www.rust-lang.org) with the [Bevy game engine](https://bevyengine.org)
- Status: Early access, not much content
@ -50,7 +50,6 @@ This game aims to respect the player as much as possible. It doesn't waste your
- M: Toggle map
- F: Toggle 3rd person view
- Y: Toggle rotation stabilizer
- F2: Toggle shadows
- F3: Toggle sound effects
- F4: Toggle music
- F7: Restart game
@ -175,12 +174,6 @@ python -m http.server -d wasm
# Changelog
- v0.8.0:
- Implement animations
- Implement shadows
- Implement markers for points of interest in the map
- Add new animated high-poly player mesh
- Add new secret character
- v0.7.3: Implement map. You can now zoom out ALL THE WAY
- v0.7.2:
- Implement colliders based on object shape

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -10,8 +10,7 @@
# + ▀████████████████████████████████████████████████████▀
#
# A script to package release binaries + README.md into zip files.
# Usage: cd outfly; build/pack.sh [-b]
# Options: -b: cross-compile targets before packing
# Usage: cd outfly; build/pack.sh
set -e

View file

@ -631,13 +631,13 @@ fn handle_cheats(
}
}
if key_input.just_pressed(settings.key_cheat_farview1) {
if let Some(target) = id2pos.0.get(&"busstopclippy2".to_string()) {
if let Some(target) = id2pos.0.get(&"busstop2".to_string()) {
pos.0 = *target + DVec3::new(0.0, -1000.0, 0.0);
gforce.ignore_gforce_seconds = 1.0;
}
}
if key_input.just_pressed(settings.key_cheat_farview2) {
if let Some(target) = id2pos.0.get(&"busstopclippy3".to_string()) {
if let Some(target) = id2pos.0.get(&"busstop3".to_string()) {
pos.0 = *target + DVec3::new(0.0, -1000.0, 0.0);
gforce.ignore_gforce_seconds = 1.0;
}

View file

@ -17,7 +17,7 @@ use bevy::input::mouse::{MouseMotion, MouseWheel};
use bevy::window::PrimaryWindow;
use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings};
use bevy::core_pipeline::tonemapping::Tonemapping;
use bevy::pbr::{CascadeShadowConfigBuilder, DirectionalLightShadowMap};
use bevy::pbr::CascadeShadowConfigBuilder;
use bevy::transform::TransformSystem;
use bevy::math::{DVec3, DQuat};
use bevy_xpbd_3d::prelude::*;
@ -80,7 +80,6 @@ impl Default for MapCam {
pub fn setup_camera(
mut commands: Commands,
settings: Res<var::Settings>,
) {
// Add player
commands.spawn((
@ -103,23 +102,19 @@ pub fn setup_camera(
// Add Light from the Sun
commands.spawn(DirectionalLightBundle {
directional_light: DirectionalLight {
illuminance: 3000.0,
shadows_enabled: settings.shadows_sun,
illuminance: 1000.0,
shadows_enabled: false,
..default()
},
transform: Transform::from_rotation(Quat::from_rotation_y(PI/2.0)),
cascade_shadow_config: CascadeShadowConfigBuilder {
num_cascades: 4,
minimum_distance: 0.1,
maximum_distance: 5000.0,
first_cascade_far_bound: 7.0,
maximum_distance: 25.0,
..default()
}.into(),
}
.into(),
..default()
});
commands.insert_resource(DirectionalLightShadowMap {
size: settings.shadowmap_resolution,
});
}
pub fn sync_camera_to_player(
@ -274,7 +269,6 @@ pub fn update_fov(
pub fn handle_input(
keyboard_input: Res<ButtonInput<KeyCode>>,
mut q_light: Query<&mut DirectionalLight>,
mut settings: ResMut<var::Settings>,
mut mapcam: ResMut<MapCam>,
mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
@ -283,12 +277,6 @@ pub fn handle_input(
if keyboard_input.just_pressed(settings.key_camera) {
settings.third_person ^= true;
}
if keyboard_input.just_pressed(settings.key_shadows) {
settings.shadows_sun ^= true;
for mut light in &mut q_light {
light.shadows_enabled = settings.shadows_sun;
}
}
if keyboard_input.just_pressed(settings.key_map) {
settings.map_active ^= true;
*mapcam = MapCam::default();
@ -622,7 +610,7 @@ pub fn find_closest_target<TargetSpecifier>(
// not on the player mesh but on the camera, which doesn't have a position.
let (angular_diameter, angle, distance) = calc_angular_diameter_known_target_vector(
trans, camera_transform, &target_vector);
if angle <= angular_diameter.clamp(0.01, PI) {
if angle <= angular_diameter.clamp(0.001, PI) {
// It's in the field of view!
//commands.entity(entity).insert(IsTargeted);
let distance_to_surface = distance - trans.scale.x;

View file

@ -850,9 +850,9 @@ pub fn handle_chat_scripts(
else {
if let Ok((mut pos, mut v)) = q_playercam.get_single_mut() {
let busstop = match param1 {
"serenity" => Some("busstopclippy"),
"farview" => Some("busstopclippy2"),
"metisprime" => Some("busstopclippy3"),
"serenity" => Some("busstop"),
"oscillation" => Some("busstop2"),
"metisprime" => Some("busstop3"),
_ => None
};
if let Some(station) = busstop {

View file

@ -19,7 +19,7 @@
- chat: ClippyTransSerenity
- set: $busstop serenity
- Welcome at StarTrans Cargo Services! You have reached Serenity Station.
- "Ready for a trip? Available bus stops: Farview Station, Metis Prime Station"
- "Ready for a trip? Available bus stops: Oscillation Station, Metis Prime Station"
- label: startransbusstop
- include: BusStops
- label: interesting
@ -33,7 +33,7 @@
- chat: ClippyTransMetis
- set: $busstop metis
- Welcome at StarTrans Cargo Services! You have reached Metis Prime Station.
- "Ready for a trip? Available bus stops: Farview Station, Serenity Station"
- "Ready for a trip? Available bus stops: Oscillation Station, Serenity Station"
- label: startransbusstop
- include: BusStops
- label: interesting
@ -45,9 +45,9 @@
---
- chat: ClippyTransFarview
- set: $busstop farview
- Welcome at StarTrans Cargo Services! You have reached Farview Station.
- chat: ClippyTransOscillation
- set: $busstop oscillation
- Welcome at StarTrans Cargo Services! You have reached Oscillation Station.
- "Ready for a trip? Available bus stops: Serenity Station, Metis Prime Station"
- label: startransbusstop
- include: BusStops
@ -59,11 +59,6 @@
- chat: BusStops
- WHY IS EVERYTHING SO GREEN???:
- StarTrans Cargo Services advertises their services with the signature green illumination.
- Thanks to this, you will find us even when your radio systems are damaged.
- StarTrans provides a beacon in the dark, creating a safer place for everybody.
- goto: startransbusstop
- Bus stop?! How does this work?:
- StarTrans Cargo Services is the most convenient way to travel the vast distances of space.
- Just activate your suit's built-in cryostasis. A StarTrans carrier will pick you up and you will wake up at your destination in the blink of an eye.
@ -72,12 +67,12 @@
- Can I take a spacecraft with me?:
- Absolutely.
- goto: startransbusstop
- if: $busstop != farview
Take me to Farview Station, please.:
- if: $busstop != oscillation
Take me to Oscillation Station, please.:
- StarTrans wishes you a pleasant journey.
- script: cryofadeout
- sleep: 5
- script: cryotrip farview
- script: cryotrip oscillation
- goto: EXIT
- if: $busstop != metis
Take me to Metis Prime Station, please.:

View file

@ -14,8 +14,7 @@ extern crate regex;
use bevy::prelude::*;
use bevy_xpbd_3d::prelude::*;
use bevy::math::DVec3;
use bevy::pbr::{NotShadowCaster, NotShadowReceiver};
use crate::{actor, camera, chat, hud, nature, shading, skeleton, var, world};
use crate::{actor, camera, chat, hud, nature, shading, skeleton, world};
use regex::Regex;
use std::f32::consts::PI;
use std::f64::consts::PI as PI64;
@ -485,7 +484,6 @@ fn spawn_entities(
mut materials: ResMut<Assets<StandardMaterial>>,
mut materials_jupiter: ResMut<Assets<shading::JupitersRing>>,
mut id2pos: ResMut<actor::Id2Pos>,
settings: Res<var::Settings>,
) {
for state_wrapper in er_spawn.read() {
let state = &state_wrapper.0;
@ -593,10 +591,6 @@ fn spawn_entities(
unlit: true,
..default()
}));
actor.insert((
NotShadowCaster,
NotShadowReceiver,
));
}
if state.is_targeted_on_startup {
actor.insert(hud::IsTargeted);
@ -635,17 +629,16 @@ fn spawn_entities(
actor.insert(actor::WantsMaxVelocity(value));
}
if let Some(color) = state.light_color {
actor.insert((
PointLight {
actor.insert(PointLightBundle {
point_light: PointLight {
intensity: state.light_brightness,
color,
range: 2000.0,
shadows_enabled: settings.shadows_pointlights,
range: 100.0,
radius: 100.0,
..default()
},
bevy::pbr::CubemapVisibleEntities::default(),
bevy::render::primitives::CubemapFrusta::default(),
));
..default()
});
}
if !state.id.is_empty() {
actor.insert(actor::Identifier(state.id.clone()));
@ -695,8 +688,6 @@ fn spawn_entities(
visibility: Visibility::Hidden,
..default()
},
NotShadowCaster,
NotShadowReceiver,
));
skeleton::load(ar_asset_name, &mut entitycmd, &*asset_server);
}
@ -710,8 +701,6 @@ fn spawn_entities(
visibility: Visibility::Hidden,
..default()
},
NotShadowCaster,
NotShadowReceiver,
));
skeleton::load("point_of_interest", &mut entitycmd, &*asset_server);
}
@ -732,8 +721,6 @@ fn spawn_entities(
Position::new(relative_pos),
Rotation::from(Quat::IDENTITY),
//Rotation::from(Quat::from_rotation_x(-0.3f32.to_radians())),
NotShadowCaster,
NotShadowReceiver,
));
}
}

View file

@ -120,7 +120,7 @@ actor 0 0 0 jupiter
clickable no
physics off
actor 0 593051 0 suitv2
actor 0 593051 0 suitv1
relativeto jupiter
orbit 224000e3 0.66
player yes
@ -207,7 +207,7 @@ actor 0 0 0 moonlet
orbit 221900e3 0.66
scale 50e3
angularmomentum 0 0.025 0
actor -55e3 44e3 0 suitv2
actor -48e3 20e3 0 suitv1
relativeto thebe
id yuni
name "Yuni"
@ -246,7 +246,7 @@ actor 0 0 0 moonlet
scale 83.5e3
angularmomentum 0 0.025 0
actor 3000 0 -300 moonlet
actor 3000 0 0 moonlet
name Moonlet
collider mesh
relativeto player
@ -266,8 +266,8 @@ actor -8200 -4400 -8100 asteroid_lum
actor 70 30 30 lightorb
relativeto Lum
name "Light Orb"
scale 3
light FF8F4A 500000000
scale 0.3
light FF8F4A 500000
actor -200 -110 1000 satellite
name "Communications Satellite"
@ -276,7 +276,7 @@ actor -200 -110 1000 satellite
wants maxrotation 0
wants maxvelocity 0
thrust 0.05 0.05 0.05 30 1
collider mesh
collider capsule 7.5 1
rotationy 0.5
angularmomentum 0 0 0
density 0.01
@ -290,7 +290,6 @@ actor 1000 20 300 monolith
wants maxrotation 0.01
angularmomentum 0.0 0.0 0.01
thrust 0 0 0 30 1
collider mesh
actor 10000 2000 -3500 monolith
name "Mysterious Monolith 2"
@ -301,7 +300,6 @@ actor 10000 2000 -3500 monolith
wants maxrotation 0.01
angularmomentum 0.0 0.0 0.01
thrust 0 0 0 30 1
collider mesh
actor -8000 -1000 -100 monolith
name "Mysterious Monolith 3"
@ -312,7 +310,6 @@ actor -8000 -1000 -100 monolith
wants maxrotation 0.01
angularmomentum 0.0 0.0 0.01
thrust 0 0 0 30 1
collider mesh
actor -3300 10 0 pizzeria
name "Pizzeria Asteroid"
@ -335,25 +332,23 @@ actor -3300 10 0 pizzeria
density 500
angularmomentum 0 0 0.2
pointofinterest yes
actor 60 60 -23 pizzasign
actor -100 63 -13 pizzasign
name "Pizzeria Sign"
relativeto pizzeria
scale 20
collider mesh
density 200
rotationy 0.45
angularmomentum 0 0 0
light "FF00B3" 30000000
actor -52 -10 0 lightorb
actor -36 -10 0 lightorb
name "Light Orb"
relativeto pizzeria
scale 0.25
light FF8F4A 5000000
actor -50 -3 -2 lightorb
scale 0.5
light FF8F4A 1000000
actor -34 -3 -2 lightorb
name "Light Orb"
relativeto pizzeria
scale 0.25
light FF8F4A 5000000
scale 0.5
light FF8F4A 1000000
actor -33 0 4 clippy
name "Clippy™ Convenience Companion"
relativeto pizzeria
@ -367,7 +362,7 @@ actor -3300 10 0 pizzeria
chatid SubduedClippy
pronoun it
actor -45 -4 -4 suitv2
actor -45 -4 -4 suitv1
relativeto pizzeria
name "Nox"
chatid PizzaChef
@ -382,7 +377,7 @@ actor -3300 10 0 pizzeria
angularmomentum 0 0 0
pronoun he
actor 30 -12 -20 suitv2
actor 60 -15 -40 suitv1
relativeto player
name Icarus
id Icarus
@ -398,28 +393,8 @@ actor 30 -12 -20 suitv2
wants maxrotation 0.5
wants maxvelocity 0
pronoun it
actor 12 -35 -27 lightorb
name "Light Orb"
relativeto Icarus
scale 0.25
light FF8F4A 5000000
actor -2 -11 -9 lightorb
name "Light Orb"
relativeto Icarus
scale 0.25
light FF8F4A 5000000
actor 26 -39 4 lightorb
name "Light Orb"
relativeto Icarus
scale 0.25
light FF8F4A 5000000
actor 1.8 -15.5 16 lightorb
name "Light Orb"
relativeto Icarus
scale 0.25
light FF8F4A 5000000
actor -300 0 40 suitv2
actor -300 0 40 suitv1
relativeto player
id Drifter
name "梓涵"
@ -430,178 +405,44 @@ actor -300 0 40 suitv2
collider handcrafted
pronoun she
actor 100 -18000 2000 clippy
relativeto "player"
id "busstopclippy"
name "StarTrans Clippy™"
armodel clippy_ar
angularmomentum 0 0 0
actor 100 -18000 2000 "orb_busstop"
relativeto player
id "busstop"
name "StarTrans Bus Stop: Serenity Station"
scale 100
pointofinterest yes
wants maxrotation 0
wants maxvelocity 0
thrust 15 6 3 400 0.5
pointofinterest yes
rotationy -0.5
scale 3
chatid ClippyTransSerenity
pronoun it
actor 60 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
actor 120 864 150 clippy
relativeto "busstop"
id "busstopclippy"
name "StarTrans Clippy™"
armodel clippy_ar
angularmomentum 0 0 0
wants maxrotation 0
wants maxvelocity 0
thrust 15 6 3 400 0.5
rotationy -0.5
scale 3
chatid ClippyTransSerenity
pronoun it
actor 40 10 40 "orb_busstop"
name "Light Orb"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 80 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
light "47FF00" 1000000
actor 30 60 -10 "orb_busstop"
name "Light Orb"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 100 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
light "47FF00" 1000000
actor -10 -60 20 "orb_busstop"
name "Light Orb"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 120 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
light "47FF00" 1000000
actor -40 20 30 "orb_busstop"
name "Light Orb"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 140 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor -60 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor -80 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor -100 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor -120 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor -140 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 60 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 80 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 100 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 120 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 140 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 -60 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 -80 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 -100 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 -120 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 -140 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 60 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 80 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 100 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 120 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 140 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 -60 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 -80 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 -100 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 -120 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 0 0 -140 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
scale 5
light "47FF00" 100000000
actor 8 2 0 suitv2
light "47FF00" 1000000
actor 8 2 0 suitv1
relativeto "busstopclippy"
name "Rudy"
wants maxrotation 0.2
@ -612,351 +453,84 @@ actor 100 -18000 2000 clippy
chatid NPCinCryoStasis
pronoun he
actor -184971e3 149410e3 -134273e3 clippy
actor -184971e3 149410e3 -134273e3 "orb_busstop"
relativeto jupiter
id "busstopclippy2"
name "StarTrans Clippy™"
armodel clippy_ar
angularmomentum 0 0 0
id "busstop2"
name "StarTrans Bus Station 'Oscillation Station'"
scale 100
pointofinterest yes
wants maxrotation 0
wants maxvelocity 0
thrust 15 6 3 400 0.5
pointofinterest yes
rotationy -0.5
scale 3
chatid ClippyTransFarview
pronoun it
actor 120 864 150 clippy
relativeto "busstop2"
id "busstopclippy2"
name "StarTrans Clippy™"
armodel clippy_ar
angularmomentum 0 0 0
wants maxrotation 0
wants maxvelocity 0
thrust 15 6 3 400 0.5
rotationy -0.5
scale 3
chatid ClippyTransOscillation
pronoun it
actor 40 10 40 "orb_busstop"
name "Light Orb"
relativeto busstopclippy2
light "47FF00" 1000000
actor 30 60 -10 "orb_busstop"
name "Light Orb"
relativeto busstopclippy2
light "47FF00" 1000000
actor -10 -60 20 "orb_busstop"
name "Light Orb"
relativeto busstopclippy2
light "47FF00" 1000000
actor -40 20 30 "orb_busstop"
name "Light Orb"
relativeto busstopclippy2
light "47FF00" 1000000
actor 60 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 80 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 100 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 120 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 140 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor -60 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor -80 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor -100 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor -120 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor -140 0 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 60 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 80 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 100 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 120 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 140 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 -60 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 -80 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 -100 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 -120 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 -140 0 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 60 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 80 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 100 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 120 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 140 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 -60 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 -80 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 -100 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 -120 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 0 0 -140 "orb_busstop"
name "StarTrans Bus Stop: Farview Station"
relativeto busstopclippy2
scale 5
light "47FF00" 100000000
actor 27643e3 -44e3 -124434e3 clippy
actor 27643e3 -44e3 -124434e3 "orb_busstop"
relativeto jupiter
id "busstopclippy3"
name "StarTrans Clippy™"
armodel clippy_ar
angularmomentum 0 0 0
id "busstop3"
name "StarTrans Bus Station 'Metis Prime'"
scale 100
pointofinterest yes
wants maxrotation 0
wants maxvelocity 0
thrust 15 6 3 400 0.5
pointofinterest yes
rotationy -0.5
scale 3
chatid ClippyTransMetis
pronoun it
actor 120 864 150 clippy
relativeto "busstop3"
id "busstopclippy3"
name "StarTrans Clippy™"
armodel clippy_ar
angularmomentum 0 0 0
wants maxrotation 0
wants maxvelocity 0
thrust 15 6 3 400 0.5
rotationy -0.5
scale 3
chatid ClippyTransMetis
pronoun it
actor 40 10 40 "orb_busstop"
name "Light Orb"
relativeto busstopclippy3
light "47FF00" 1000000
actor 30 60 -10 "orb_busstop"
name "Light Orb"
relativeto busstopclippy3
light "47FF00" 1000000
actor -10 -60 20 "orb_busstop"
name "Light Orb"
relativeto busstopclippy3
light "47FF00" 1000000
actor -40 20 30 "orb_busstop"
name "Light Orb"
relativeto busstopclippy3
light "47FF00" 1000000
actor 60 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 80 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 100 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 120 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 140 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor -60 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor -80 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor -100 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor -120 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor -140 0 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 60 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 80 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 100 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 120 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 140 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 -60 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 -80 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 -100 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 -120 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 -140 0 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 60 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 80 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 100 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 120 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 140 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 -60 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 -80 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 -100 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 -120 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 0 0 -140 "orb_busstop"
name "StarTrans Bus Stop: Metis Prime Station"
relativeto busstopclippy3
scale 5
light "47FF00" 100000000
actor 110 0 2000 whale
relativeto busstopclippy3
actor 110 -2000 0 whale
relativeto busstop3
name "The Whale"
vehicle yes
collider mesh

View file

@ -26,7 +26,7 @@ pub const LOG_MAX_ROWS: usize = 30;
pub const LOG_MAX: usize = LOG_MAX_ROWS;
pub const MAX_CHOICES: usize = 10;
pub const AMBIENT_LIGHT: f32 = 0.0; // Space is DARK
pub const AMBIENT_LIGHT_AR: f32 = 30.0;
pub const AMBIENT_LIGHT_AR: f32 = 15.0;
//pub const REPLY_NUMBERS: [char; 10] = ['❶', '❷', '❸', '❹', '❺', '❻', '❼', '❽', '❾', '⓿'];
//pub const REPLY_NUMBERS: [char; 10] = ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩'];
pub const REPLY_NUMBERS: [char; 10] = ['➀', '➁', '➂', '➃', '➄', '➅', '➆', '➇', '➈', '➉'];
@ -76,6 +76,7 @@ impl Plugin for HudPlugin {
#[derive(Component)] struct Reticule;
#[derive(Component)] pub struct ToggleableHudElement;
#[derive(Component)] pub struct ToggleableHudMapElement;
#[derive(Component)] struct OnlyHideWhenTogglingHud;
#[derive(Component)] struct Selectagon;
#[derive(Component)] pub struct IsTargeted;
#[derive(Component)] pub struct PointOfInterestMarker(pub Entity);
@ -193,7 +194,7 @@ fn setup(
mut commands: Commands,
settings: Res<var::Settings>,
asset_server: Res<AssetServer>,
mut ew_updateoverlays: EventWriter<UpdateOverlayVisibility>,
mut ambient_light: ResMut<AmbientLight>,
) {
let visibility = if settings.hud_active {
Visibility::Inherited
@ -359,6 +360,8 @@ fn setup(
// Selectagon
let mut entitycmd = commands.spawn((
Selectagon,
ToggleableHudElement,
OnlyHideWhenTogglingHud,
SpatialBundle {
visibility: Visibility::Hidden,
..default()
@ -366,7 +369,12 @@ fn setup(
));
skeleton::load("selectagon", &mut entitycmd, &*asset_server);
ew_updateoverlays.send(UpdateOverlayVisibility);
// AR-related things
ambient_light.brightness = if settings.hud_active {
AMBIENT_LIGHT_AR
} else {
AMBIENT_LIGHT
};
}
fn update_hud(
@ -469,15 +477,14 @@ fn update_hud(
}
}
// let dev_speed = if settings.dev_mode {
// let x = pos.x;
// let y = pos.y;
// let z = pos.z;
// format!("\n{x:.0}\n{y:.0}\n{z:.0}")
// } else {
// "".to_string()
// };
let dev_speed = "";
let dev_speed = if settings.dev_mode {
let x = pos.x;
let y = pos.y;
let z = pos.z;
format!("\n{x:.0}\n{y:.0}\n{z:.0}")
} else {
"".to_string()
};
let gforce = gforce.gforce;
let speed = cam_v.length();
let speed_readable = nature::readable_distance(speed);
@ -643,6 +650,7 @@ fn handle_input(
mut ew_togglemusic: EventWriter<audio::ToggleMusicEvent>,
mut ew_target: EventWriter<TargetEvent>,
mut ew_updateoverlays: EventWriter<UpdateOverlayVisibility>,
mut ambient_light: ResMut<AmbientLight>,
q_objects: Query<(Entity, &Transform), (With<IsClickable>, Without<IsTargeted>, Without<actor::PlayerDrivesThis>, Without<actor::Player>)>,
q_camera: Query<&Transform, With<Camera>>,
) {
@ -652,10 +660,15 @@ fn handle_input(
}
}
if keyboard_input.just_pressed(settings.key_togglehud) {
ew_updateoverlays.send(UpdateOverlayVisibility);
settings.hud_active ^= true;
if settings.hud_active {
ambient_light.brightness = AMBIENT_LIGHT_AR;
} else {
ambient_light.brightness = AMBIENT_LIGHT;
}
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Switch));
ew_togglemusic.send(audio::ToggleMusicEvent());
ew_updateoverlays.send(UpdateOverlayVisibility);
}
if settings.hud_active && mouse_input.just_pressed(settings.key_selectobject) {
if let Ok(camtrans) = q_camera.get_single() {
@ -714,7 +727,7 @@ fn update_target_selectagon(
}
selectagon_trans.translation = target_trans.translation;
selectagon_trans.scale = target_trans.scale;
selectagon_trans.look_at(camera_trans.translation, target_trans.up().into());
selectagon_trans.look_at(camera_trans.translation, Vec3::X);
// Enlarge Selectagon to a minimum angular diameter
let (angular_diameter, _, _) = camera::calc_angular_diameter(
@ -798,9 +811,6 @@ fn update_poi_overlays (
fn update_overlay_visibility(
mut q_marker: Query<&mut Visibility, With<PointOfInterestMarker>>,
mut q_hudelement: Query<&mut Visibility, (With<ToggleableHudElement>, Without<PointOfInterestMarker>)>,
mut q_selectagon: Query<&mut Visibility, (With<Selectagon>, Without<ToggleableHudElement>, Without<PointOfInterestMarker>)>,
q_target: Query<&IsTargeted, (Without<Camera>, Without<Selectagon>, Without<PointOfInterestMarker>, Without<ToggleableHudElement>)>,
mut ambient_light: ResMut<AmbientLight>,
er_target: EventReader<UpdateOverlayVisibility>,
settings: Res<var::Settings>,
) {
@ -812,20 +822,10 @@ fn update_overlay_visibility(
};
let show_poi = check(settings.hud_active && settings.map_active);
let show_hud = check(settings.hud_active);
let show_selectagon = check(settings.hud_active && !q_target.is_empty());
for mut vis in &mut q_marker {
*vis = show_poi;
}
for mut vis in &mut q_hudelement {
*vis = show_hud;
}
for mut vis in &mut q_selectagon {
*vis = show_selectagon;
}
ambient_light.brightness = if settings.hud_active {
AMBIENT_LIGHT_AR
} else {
AMBIENT_LIGHT
};
}

View file

@ -18,14 +18,12 @@ pub struct SkeletonPlugin;
impl Plugin for SkeletonPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Update, animate_skeleton_parts);
app.add_systems(Update, play_animations);
}
}
pub fn asset_name_to_path(name: &str) -> &'static str {
match name {
"suitv2" => "models/suit_v2/suit_v2.glb#Scene0",
"suit_ar_chefhat" => "models/suit_v2/ar_chefhat.glb#Scene0",
"suit_ar_chefhat" => "models/suit_v1/ar_chefhat.glb#Scene0",
"asteroid1" => "models/asteroid.glb#Scene0",
"asteroid2" => "models/asteroid2.glb#Scene0",
"asteroid_lum" => "models/asteroid_lum.glb#Scene0",
@ -231,6 +229,13 @@ pub fn load(
}
}
//pub fn load_scene(
// path: &str,
// asset_server: &AssetServer
//) -> Handle<Scene> {
// load_scene_by_path(asset_name_to_path(path), asset_server)
//}
#[inline]
pub fn load_scene_by_path(
path: &str,
@ -322,34 +327,3 @@ pub fn animate_human_float(mut trans: &mut Transform, limb: &Limb, mirror: bool,
_ => {},
}
}
fn play_animations(
mut players: Query<&mut AnimationPlayer, Added<AnimationPlayer>>,
asset_server: Res<AssetServer>,
) {
for mut player in &mut players {
let animation = asset_server.load("models/suit_v2/suit_v2.glb#Animation0");
player.play(animation.clone()).repeat();
}
}
//fn play_animations(
// players: Query<(Entity, &Parent, &AnimationPlayer), Added<AnimationPlayer>>,
// q_parents: Query<(Entity, &Parent)>,
// world: &World,
//) {
// for (entity, parent, player) in &players {
// info!("Got player!");
//// dbg!(world.inspect_entity(entity));
//// let parent_entity = q_parents.get(parent.get());
//// if let Ok((parent_entity, parent_parents)) = parent_entity {
//// //dbg!(world.inspect_entity(parent_entity));
//// let parent_entity = q_parents.get(parent_parents.get());
//// if let Ok((parent_entity, parent_parents)) = parent_entity {
//// dbg!(world.inspect_entity(parent_entity));
//// }
//// }
// //dbg!(player);
// //player.play(animations.0[0].clone_weak()).repeat();
// }
//}

View file

@ -58,9 +58,6 @@ pub struct Settings {
pub is_zooming: bool,
pub third_person: bool,
pub rotation_stabilizer_active: bool,
pub shadows_sun: bool,
pub shadows_pointlights: bool,
pub shadowmap_resolution: usize,
pub key_selectobject: MouseButton,
pub key_zoom: MouseButton,
pub key_map: KeyCode,
@ -84,7 +81,6 @@ pub struct Settings {
pub key_interact: KeyCode,
pub key_vehicle: KeyCode,
pub key_camera: KeyCode,
pub key_shadows: KeyCode,
pub key_rotate: KeyCode,
pub key_rotation_stabilizer: KeyCode,
pub key_mouseup: KeyCode,
@ -172,9 +168,6 @@ impl Default for Settings {
is_zooming: false,
third_person: false,
rotation_stabilizer_active: true,
shadows_sun: true,
shadows_pointlights: false,
shadowmap_resolution: 2048,
key_selectobject: MouseButton::Left,
key_zoom: MouseButton::Right,
key_map: KeyCode::KeyM,
@ -198,7 +191,6 @@ impl Default for Settings {
key_interact: KeyCode::KeyE,
key_vehicle: KeyCode::KeyQ,
key_camera: KeyCode::KeyF,
key_shadows: KeyCode::F2,
key_rotate: KeyCode::KeyR,
key_rotation_stabilizer: KeyCode::KeyY,
key_mouseup: KeyCode::KeyI,

View file

@ -172,7 +172,7 @@ fn spawn_despawn_asteroids(
q_player: Query<&Position, With<actor::PlayerCamera>>,
mut ew_despawn: EventWriter<DespawnEvent>,
mut db: ResMut<ActiveAsteroids>,
q_asteroid: Query<(&Position, &SceneInstance), With<Asteroid>>,
mut q_asteroid: Query<(Entity, &SceneInstance), With<Asteroid>>,
mut last_player_cell: Local<I64Vec3>,
id2pos: Res<actor::Id2Pos>,
asset_server: Res<AssetServer>,
@ -216,15 +216,19 @@ fn spawn_despawn_asteroids(
|| origin.y < y_min || origin.y > y_max
|| origin.z < z_min || origin.z > z_max
{
if let Ok((pos, sceneinstance)) = q_asteroid.get(asteroid.entity) {
if pos.0.distance(player.0) > 1000.0 {
let mut despawning_worked = false;
for (ent, sceneinstance) in &mut q_asteroid {
if ent == asteroid.entity {
ew_despawn.send(DespawnEvent {
entity: asteroid.entity,
sceneinstance: **sceneinstance,
origin: origin.clone(),
});
despawning_worked = true;
break;
}
} else {
}
if !despawning_worked {
error!("Couldn't despawn asteroid:");
dbg!(origin);
}