Everything works!... except animation...

main
Elijah C. Voigt 2 years ago
parent de30eaf06a
commit 87b6672631

@ -41,6 +41,11 @@ invalid = "/sfx/3D/3DInvalidMove"
### ###
msaa = "Off" msaa = "Off"
###
# Enable HDR lighting
###
hdr = true
### ###
# Screen Space Ambient Occlusion # Screen Space Ambient Occlusion
# https://docs.rs/bevy/0.11.3/bevy/pbr/enum.ScreenSpaceAmbientOcclusionQualityLevel.html # https://docs.rs/bevy/0.11.3/bevy/pbr/enum.ScreenSpaceAmbientOcclusionQualityLevel.html
@ -101,8 +106,8 @@ Rgba = { red = 1.0, green = 1.0, blue = 1.0, alpha = 0.0 }
# Fog Faloff # Fog Faloff
# https://docs.rs/bevy/0.11.3/bevy/pbr/enum.FogFalloff.html # https://docs.rs/bevy/0.11.3/bevy/pbr/enum.FogFalloff.html
### ###
# [display3d.fog.falloff] [display3d.fog.falloff]
# Exponential = { density = 0.005 } Exponential = { density = 0.005 }
# Examples: # Examples:
# * Linear = { start = 1.0, end = 10.0 } # * Linear = { start = 1.0, end = 10.0 }
# * Exponential = { density = 1.0 } # * Exponential = { density = 1.0 }

@ -27,9 +27,6 @@ impl Plugin for DebugPlugin {
display_diagnostics.run_if(resource_exists::<DebugEnabled>()), display_diagnostics.run_if(resource_exists::<DebugEnabled>()),
toggle_debug_ui.run_if(resource_changed_or_removed::<DebugEnabled>()), toggle_debug_ui.run_if(resource_changed_or_removed::<DebugEnabled>()),
camera_info.run_if(resource_exists::<DebugEnabled>()), camera_info.run_if(resource_exists::<DebugEnabled>()),
// debug_asset_event::<Gltf>.run_if(on_event::<AssetEvent<Gltf>>()),
// debug_asset_event::<Image>.run_if(on_event::<AssetEvent<Image>>()),
debug_asset_event::<tweak::Tweaks>.run_if(on_event::<AssetEvent<tweak::Tweaks>>()),
), ),
); );
} }
@ -142,9 +139,3 @@ fn camera_info(mut debug_infos: ResMut<DebugInfo>, cameras: Query<(&Camera, &Nam
.collect::<String>(); .collect::<String>();
debug_infos.set("Cameras".into(), camera_names); debug_infos.set("Cameras".into(), camera_names);
} }
fn debug_asset_event<T: Asset>(mut reader: EventReader<AssetEvent<T>>) {
reader.read().for_each(|e| {
info!("Asset Event: {:?}", e);
});
}

@ -336,7 +336,7 @@ fn fix_skybox(
) { ) {
let tweak = tweaks.get(tweaks_file.handle.clone()).unwrap(); let tweak = tweaks.get(tweaks_file.handle.clone()).unwrap();
let handle = tweak let handle = tweak
.get_handle::<Image>("display3d_models_skybox_file") .get_handle_unchecked::<Image>("display3d_models_skybox_file")
.unwrap(); .unwrap();
let image = images.get_mut(handle).unwrap(); let image = images.get_mut(handle).unwrap();

@ -67,7 +67,7 @@ fn loading(
.ids() .ids()
.all(|id| server.is_loaded_with_dependencies(id)); .all(|id| server.is_loaded_with_dependencies(id));
info!("s {} g {} t {}", s, g, t); debug!("s {} g {} t {}", s, g, t);
if t { if t {
// s && g && t { // s && g && t {

@ -1,5 +1,7 @@
#![feature(iter_array_chunks)] // used in ray.rs #![feature(iter_array_chunks)] // used in ray.rs
#![feature(iter_intersperse)] // used in debug.rs #![feature(iter_intersperse)] // used in debug.rs
#![feature(async_closure)] // Loading tweakfiles
mod audio; mod audio;
mod credits; mod credits;

@ -46,7 +46,17 @@ impl Tweaks {
.filter_map(|(k, v)| match v { .filter_map(|(k, v)| match v {
toml::Value::String(s) => std::path::Path::new(format!("assets/{}", s).as_str()) toml::Value::String(s) => std::path::Path::new(format!("assets/{}", s).as_str())
.exists() .exists()
.then(|| (k.clone(), load_context.load_untyped(s).untyped())), .then(|| {
if s.ends_with(".gltf") || s.ends_with(".glb") {
Some(load_context.load::<Gltf>(s).untyped())
} else if s.ends_with(".png") {
Some(load_context.load::<Image>(s).untyped())
} else {
None
}
}).flatten().map(|h| {
(k.clone(), h)
}),
_ => None, _ => None,
}) })
.collect(); .collect();
@ -69,8 +79,10 @@ impl Tweaks {
pub fn get<'de, T: Deserialize<'de>>(&self, key: &str) -> Option<T> { pub fn get<'de, T: Deserialize<'de>>(&self, key: &str) -> Option<T> {
Tweaks::locate(&self.table, key) Tweaks::locate(&self.table, key)
.map(|val| val.try_into().ok()) .map(|val| match val.try_into() {
.flatten() Ok(val) => val,
Err(e) => panic!("{}", e.message())
})
} }
fn iter_all(t: &toml::Table, key: &str) -> Vec<(String, toml::Value)> { fn iter_all(t: &toml::Table, key: &str) -> Vec<(String, toml::Value)> {

Loading…
Cancel
Save