Compare commits

...

43 Commits

Author SHA1 Message Date
hut 330da6c7fc bump version to 8.0.0 2024-04-24 21:25:06 +02:00
hut 1cf4d28609 fix selectagon's spontaneous rotation 2024-04-24 21:20:28 +02:00
hut 2b07ef67d1 copy serenity station's new style to the other bus stops 2024-04-24 21:17:41 +02:00
hut 0dda705db2 rename oscillation station to farview station 2024-04-24 21:07:29 +02:00
hut 48b1b7b72b prettier serenity station 2024-04-24 21:04:33 +02:00
hut 5b38b78c70 cleanup 2024-04-24 20:47:51 +02:00
hut 2e81a059fa update README descriptions 2024-04-24 20:46:27 +02:00
hut 9a2516aa60 move secret character 2024-04-24 20:40:52 +02:00
hut d1dc3da34f easier targeting of small objects 2024-04-24 20:40:40 +02:00
hut e3de0d56f7 add F2 key to toggle shadows 2024-04-24 20:40:20 +02:00
hut 6d8341ba56 lower shadow distance 2024-04-24 20:17:37 +02:00
hut 9c9d92bb8e add chat option about the greenness of bus stations 2024-04-24 20:13:43 +02:00
hut 7ec5b3e493 boost AR ambient light 2024-04-24 20:08:09 +02:00
hut b80cc9387f fix selectagon hiding 2024-04-24 20:02:51 +02:00
hut b5878802a3 cleanup 2024-04-24 19:59:14 +02:00
hut 4c26f2ef4f implement shadows, tweak world objects for better visibility 2024-04-24 19:54:37 +02:00
hut f0df596ea1 better lights at pizzeria and bus stations 2024-04-24 17:27:13 +02:00
hut 579a354f50 brighter directional illumination 2024-04-24 16:58:56 +02:00
hut b0407135a1 better light at bus stops 2024-04-24 05:37:27 +02:00
hut ae4a6b1f82 add mesh collider to pizza sign 2024-04-24 05:05:41 +02:00
hut 4ea35f8a67 fix selectagon flicker for good 2024-04-24 05:05:31 +02:00
hut 4c316e36a6 despawn asteroids only when they're 1km+ away 2024-04-24 04:37:10 +02:00
hut 656d7f02f0 cleanup 2024-04-24 04:30:59 +02:00
hut 343bba314c tweak Lum light 2024-04-24 04:18:05 +02:00
hut 3ded8103d5 fix bad lighting effect 2024-04-24 04:13:36 +02:00
hut bf62689fe2 fix inability to scale model of light sources 2024-04-24 04:13:01 +02:00
hut 2522367026 simplify setting ambient light on hud toggle 2024-04-24 03:58:11 +02:00
hut 90372afaef cleanup 2024-04-24 03:56:23 +02:00
hut 366500e928 fix selectagon flickering on hud toggle 2024-04-24 03:55:45 +02:00
hut fe89308a94 hide player coordinate in dev mode 2024-04-24 03:49:26 +02:00
hut c57a4a13f8 give monoliths and satellite a mesh collider 2024-04-24 03:49:01 +02:00
hut 5be2c78173 write changelog 2024-04-24 03:17:41 +02:00
hut 03b755b2f0 Merge branch 'anim3' 2024-04-24 03:09:13 +02:00
hut 623c675489 remove old suit 2024-04-24 03:08:25 +02:00
hut ed2d2bde07 cleanup 2024-04-24 03:08:14 +02:00
hut be9f439d6e update chef hat AR overlay 2024-04-24 03:03:18 +02:00
hut 69008bb91a Revert "change some settings for more convenient animation development"
This reverts commit 3a230dd3f0.
2024-04-24 02:57:23 +02:00
hut d38bf45a9c add space suit v2 2024-04-24 02:56:39 +02:00
hut 3a230dd3f0 change some settings for more convenient animation development 2024-04-23 19:10:03 +02:00
hut 00a23eb0b0 WIP animated player 2024-04-23 19:08:27 +02:00
hut 88037b3b74 fix animation dependency 2024-04-23 19:06:02 +02:00
hut 8d5cbf7e73 add animation dependency 2024-04-23 17:57:19 +02:00
hut 1d743a9326 document pack.sh option 2024-04-23 17:57:11 +02:00
23 changed files with 714 additions and 199 deletions

23
Cargo.lock generated
View File

@ -304,6 +304,25 @@ 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"
@ -550,6 +569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21ecf404295055deb7fe037495891bc135ca10d46bc5b6c55f9ab7b7ebc61d31"
dependencies = [
"base64",
"bevy_animation",
"bevy_app",
"bevy_asset",
"bevy_core",
@ -608,6 +628,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f58ec0ce77603df9474cde61f429126bfe06eb79094440e9141afb4217751c79"
dependencies = [
"bevy_a11y",
"bevy_animation",
"bevy_app",
"bevy_asset",
"bevy_audio",
@ -2737,7 +2758,7 @@ dependencies = [
[[package]]
name = "outfly"
version = "0.7.3"
version = "0.8.0"
dependencies = [
"bevy",
"bevy_embedded_assets",

View File

@ -10,7 +10,7 @@
[package]
name = "outfly"
version = "0.7.3"
version = "0.8.0"
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 = ["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 = { 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_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, 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.
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.
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
- 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)
- 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!
- Written in [Rust](https://www.rust-lang.org) with the [Bevy game engine](https://bevyengine.org)
- Status: Early access, not much content
@ -50,6 +50,7 @@ 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
@ -174,6 +175,12 @@ 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,7 +10,8 @@
# + ▀████████████████████████████████████████████████████▀
#
# A script to package release binaries + README.md into zip files.
# Usage: cd outfly; build/pack.sh
# Usage: cd outfly; build/pack.sh [-b]
# Options: -b: cross-compile targets before packing
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(&"busstop2".to_string()) {
if let Some(target) = id2pos.0.get(&"busstopclippy2".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(&"busstop3".to_string()) {
if let Some(target) = id2pos.0.get(&"busstopclippy3".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;
use bevy::pbr::{CascadeShadowConfigBuilder, DirectionalLightShadowMap};
use bevy::transform::TransformSystem;
use bevy::math::{DVec3, DQuat};
use bevy_xpbd_3d::prelude::*;
@ -80,6 +80,7 @@ impl Default for MapCam {
pub fn setup_camera(
mut commands: Commands,
settings: Res<var::Settings>,
) {
// Add player
commands.spawn((
@ -102,19 +103,23 @@ pub fn setup_camera(
// Add Light from the Sun
commands.spawn(DirectionalLightBundle {
directional_light: DirectionalLight {
illuminance: 1000.0,
shadows_enabled: false,
illuminance: 3000.0,
shadows_enabled: settings.shadows_sun,
..default()
},
transform: Transform::from_rotation(Quat::from_rotation_y(PI/2.0)),
cascade_shadow_config: CascadeShadowConfigBuilder {
first_cascade_far_bound: 7.0,
maximum_distance: 25.0,
num_cascades: 4,
minimum_distance: 0.1,
maximum_distance: 5000.0,
..default()
}
.into(),
}.into(),
..default()
});
commands.insert_resource(DirectionalLightShadowMap {
size: settings.shadowmap_resolution,
});
}
pub fn sync_camera_to_player(
@ -269,6 +274,7 @@ 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>,
@ -277,6 +283,12 @@ 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();
@ -610,7 +622,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.001, PI) {
if angle <= angular_diameter.clamp(0.01, 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("busstop"),
"oscillation" => Some("busstop2"),
"metisprime" => Some("busstop3"),
"serenity" => Some("busstopclippy"),
"farview" => Some("busstopclippy2"),
"metisprime" => Some("busstopclippy3"),
_ => 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: Oscillation Station, Metis Prime Station"
- "Ready for a trip? Available bus stops: Farview 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: Oscillation Station, Serenity Station"
- "Ready for a trip? Available bus stops: Farview Station, Serenity Station"
- label: startransbusstop
- include: BusStops
- label: interesting
@ -45,9 +45,9 @@
---
- chat: ClippyTransOscillation
- set: $busstop oscillation
- Welcome at StarTrans Cargo Services! You have reached Oscillation Station.
- chat: ClippyTransFarview
- set: $busstop farview
- Welcome at StarTrans Cargo Services! You have reached Farview Station.
- "Ready for a trip? Available bus stops: Serenity Station, Metis Prime Station"
- label: startransbusstop
- include: BusStops
@ -59,6 +59,11 @@
- 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.
@ -67,12 +72,12 @@
- Can I take a spacecraft with me?:
- Absolutely.
- goto: startransbusstop
- if: $busstop != oscillation
Take me to Oscillation Station, please.:
- if: $busstop != farview
Take me to Farview Station, please.:
- StarTrans wishes you a pleasant journey.
- script: cryofadeout
- sleep: 5
- script: cryotrip oscillation
- script: cryotrip farview
- goto: EXIT
- if: $busstop != metis
Take me to Metis Prime Station, please.:

View File

@ -14,7 +14,8 @@ extern crate regex;
use bevy::prelude::*;
use bevy_xpbd_3d::prelude::*;
use bevy::math::DVec3;
use crate::{actor, camera, chat, hud, nature, shading, skeleton, world};
use bevy::pbr::{NotShadowCaster, NotShadowReceiver};
use crate::{actor, camera, chat, hud, nature, shading, skeleton, var, world};
use regex::Regex;
use std::f32::consts::PI;
use std::f64::consts::PI as PI64;
@ -484,6 +485,7 @@ 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;
@ -591,6 +593,10 @@ fn spawn_entities(
unlit: true,
..default()
}));
actor.insert((
NotShadowCaster,
NotShadowReceiver,
));
}
if state.is_targeted_on_startup {
actor.insert(hud::IsTargeted);
@ -629,16 +635,17 @@ fn spawn_entities(
actor.insert(actor::WantsMaxVelocity(value));
}
if let Some(color) = state.light_color {
actor.insert(PointLightBundle {
point_light: PointLight {
actor.insert((
PointLight {
intensity: state.light_brightness,
color,
range: 100.0,
radius: 100.0,
range: 2000.0,
shadows_enabled: settings.shadows_pointlights,
..default()
},
..default()
});
bevy::pbr::CubemapVisibleEntities::default(),
bevy::render::primitives::CubemapFrusta::default(),
));
}
if !state.id.is_empty() {
actor.insert(actor::Identifier(state.id.clone()));
@ -688,6 +695,8 @@ fn spawn_entities(
visibility: Visibility::Hidden,
..default()
},
NotShadowCaster,
NotShadowReceiver,
));
skeleton::load(ar_asset_name, &mut entitycmd, &*asset_server);
}
@ -701,6 +710,8 @@ fn spawn_entities(
visibility: Visibility::Hidden,
..default()
},
NotShadowCaster,
NotShadowReceiver,
));
skeleton::load("point_of_interest", &mut entitycmd, &*asset_server);
}
@ -721,6 +732,8 @@ 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 suitv1
actor 0 593051 0 suitv2
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 -48e3 20e3 0 suitv1
actor -55e3 44e3 0 suitv2
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 0 moonlet
actor 3000 0 -300 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 0.3
light FF8F4A 500000
scale 3
light FF8F4A 500000000
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 capsule 7.5 1
collider mesh
rotationy 0.5
angularmomentum 0 0 0
density 0.01
@ -290,6 +290,7 @@ 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"
@ -300,6 +301,7 @@ 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"
@ -310,6 +312,7 @@ 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"
@ -332,23 +335,25 @@ actor -3300 10 0 pizzeria
density 500
angularmomentum 0 0 0.2
pointofinterest yes
actor -100 63 -13 pizzasign
actor 60 60 -23 pizzasign
name "Pizzeria Sign"
relativeto pizzeria
scale 20
collider mesh
density 200
rotationy 0.45
angularmomentum 0 0 0
actor -36 -10 0 lightorb
light "FF00B3" 30000000
actor -52 -10 0 lightorb
name "Light Orb"
relativeto pizzeria
scale 0.5
light FF8F4A 1000000
actor -34 -3 -2 lightorb
scale 0.25
light FF8F4A 5000000
actor -50 -3 -2 lightorb
name "Light Orb"
relativeto pizzeria
scale 0.5
light FF8F4A 1000000
scale 0.25
light FF8F4A 5000000
actor -33 0 4 clippy
name "Clippy™ Convenience Companion"
relativeto pizzeria
@ -362,7 +367,7 @@ actor -3300 10 0 pizzeria
chatid SubduedClippy
pronoun it
actor -45 -4 -4 suitv1
actor -45 -4 -4 suitv2
relativeto pizzeria
name "Nox"
chatid PizzaChef
@ -377,7 +382,7 @@ actor -3300 10 0 pizzeria
angularmomentum 0 0 0
pronoun he
actor 60 -15 -40 suitv1
actor 30 -12 -20 suitv2
relativeto player
name Icarus
id Icarus
@ -393,8 +398,28 @@ actor 60 -15 -40 suitv1
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 suitv1
actor -300 0 40 suitv2
relativeto player
id Drifter
name "梓涵"
@ -405,44 +430,178 @@ actor -300 0 40 suitv1
collider handcrafted
pronoun she
actor 100 -18000 2000 "orb_busstop"
relativeto player
id "busstop"
name "StarTrans Bus Stop: Serenity Station"
scale 100
pointofinterest yes
actor 100 -18000 2000 clippy
relativeto "player"
id "busstopclippy"
name "StarTrans Clippy™"
armodel clippy_ar
angularmomentum 0 0 0
wants maxrotation 0
wants maxvelocity 0
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"
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"
relativeto busstopclippy
light "47FF00" 1000000
actor 30 60 -10 "orb_busstop"
name "Light Orb"
scale 5
light "47FF00" 100000000
actor 80 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
light "47FF00" 1000000
actor -10 -60 20 "orb_busstop"
name "Light Orb"
scale 5
light "47FF00" 100000000
actor 100 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
light "47FF00" 1000000
actor -40 20 30 "orb_busstop"
name "Light Orb"
scale 5
light "47FF00" 100000000
actor 120 0 0 "orb_busstop"
name "StarTrans Bus Stop: Serenity Station"
relativeto busstopclippy
light "47FF00" 1000000
actor 8 2 0 suitv1
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
relativeto "busstopclippy"
name "Rudy"
wants maxrotation 0.2
@ -453,84 +612,351 @@ actor 100 -18000 2000 "orb_busstop"
chatid NPCinCryoStasis
pronoun he
actor -184971e3 149410e3 -134273e3 "orb_busstop"
actor -184971e3 149410e3 -134273e3 clippy
relativeto jupiter
id "busstop2"
name "StarTrans Bus Station 'Oscillation Station'"
scale 100
pointofinterest yes
id "busstopclippy2"
name "StarTrans Clippy™"
armodel clippy_ar
angularmomentum 0 0 0
wants maxrotation 0
wants maxvelocity 0
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 27643e3 -44e3 -124434e3 "orb_busstop"
relativeto jupiter
id "busstop3"
name "StarTrans Bus Station 'Metis Prime'"
scale 100
thrust 15 6 3 400 0.5
pointofinterest yes
rotationy -0.5
scale 3
chatid ClippyTransFarview
pronoun it
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
relativeto jupiter
id "busstopclippy3"
name "StarTrans Clippy™"
armodel clippy_ar
angularmomentum 0 0 0
wants maxrotation 0
wants maxvelocity 0
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
thrust 15 6 3 400 0.5
pointofinterest yes
rotationy -0.5
scale 3
chatid ClippyTransMetis
pronoun it
actor 110 -2000 0 whale
relativeto busstop3
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
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 = 15.0;
pub const AMBIENT_LIGHT_AR: f32 = 30.0;
//pub const REPLY_NUMBERS: [char; 10] = ['❶', '❷', '❸', '❹', '❺', '❻', '❼', '❽', '❾', '⓿'];
//pub const REPLY_NUMBERS: [char; 10] = ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩'];
pub const REPLY_NUMBERS: [char; 10] = ['➀', '➁', '➂', '➃', '➄', '➅', '➆', '➇', '➈', '➉'];
@ -76,7 +76,6 @@ 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);
@ -194,7 +193,7 @@ fn setup(
mut commands: Commands,
settings: Res<var::Settings>,
asset_server: Res<AssetServer>,
mut ambient_light: ResMut<AmbientLight>,
mut ew_updateoverlays: EventWriter<UpdateOverlayVisibility>,
) {
let visibility = if settings.hud_active {
Visibility::Inherited
@ -360,8 +359,6 @@ fn setup(
// Selectagon
let mut entitycmd = commands.spawn((
Selectagon,
ToggleableHudElement,
OnlyHideWhenTogglingHud,
SpatialBundle {
visibility: Visibility::Hidden,
..default()
@ -369,12 +366,7 @@ fn setup(
));
skeleton::load("selectagon", &mut entitycmd, &*asset_server);
// AR-related things
ambient_light.brightness = if settings.hud_active {
AMBIENT_LIGHT_AR
} else {
AMBIENT_LIGHT
};
ew_updateoverlays.send(UpdateOverlayVisibility);
}
fn update_hud(
@ -477,14 +469,15 @@ 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 = 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 gforce = gforce.gforce;
let speed = cam_v.length();
let speed_readable = nature::readable_distance(speed);
@ -650,7 +643,6 @@ 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>>,
) {
@ -660,15 +652,10 @@ 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() {
@ -727,7 +714,7 @@ fn update_target_selectagon(
}
selectagon_trans.translation = target_trans.translation;
selectagon_trans.scale = target_trans.scale;
selectagon_trans.look_at(camera_trans.translation, Vec3::X);
selectagon_trans.look_at(camera_trans.translation, target_trans.up().into());
// Enlarge Selectagon to a minimum angular diameter
let (angular_diameter, _, _) = camera::calc_angular_diameter(
@ -811,6 +798,9 @@ 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>,
) {
@ -822,10 +812,20 @@ 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,12 +18,14 @@ 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 {
"suit_ar_chefhat" => "models/suit_v1/ar_chefhat.glb#Scene0",
"suitv2" => "models/suit_v2/suit_v2.glb#Scene0",
"suit_ar_chefhat" => "models/suit_v2/ar_chefhat.glb#Scene0",
"asteroid1" => "models/asteroid.glb#Scene0",
"asteroid2" => "models/asteroid2.glb#Scene0",
"asteroid_lum" => "models/asteroid_lum.glb#Scene0",
@ -229,13 +231,6 @@ 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,
@ -327,3 +322,34 @@ 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,6 +58,9 @@ 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,
@ -81,6 +84,7 @@ 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,
@ -168,6 +172,9 @@ 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,
@ -191,6 +198,7 @@ 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>,
mut q_asteroid: Query<(Entity, &SceneInstance), With<Asteroid>>,
q_asteroid: Query<(&Position, &SceneInstance), With<Asteroid>>,
mut last_player_cell: Local<I64Vec3>,
id2pos: Res<actor::Id2Pos>,
asset_server: Res<AssetServer>,
@ -216,19 +216,15 @@ fn spawn_despawn_asteroids(
|| origin.y < y_min || origin.y > y_max
|| origin.z < z_min || origin.z > z_max
{
let mut despawning_worked = false;
for (ent, sceneinstance) in &mut q_asteroid {
if ent == asteroid.entity {
if let Ok((pos, sceneinstance)) = q_asteroid.get(asteroid.entity) {
if pos.0.distance(player.0) > 1000.0 {
ew_despawn.send(DespawnEvent {
entity: asteroid.entity,
sceneinstance: **sceneinstance,
origin: origin.clone(),
});
despawning_worked = true;
break;
}
}
if !despawning_worked {
} else {
error!("Couldn't despawn asteroid:");
dbg!(origin);
}