diff --git a/src/display3d.rs b/src/display3d.rs index 0c55e87..a52bda0 100644 --- a/src/display3d.rs +++ b/src/display3d.rs @@ -251,7 +251,7 @@ fn hydrate_camera( BloomSettings { ..default() }, Skybox { image: skybox_handle.clone(), - brightness: 1.0, + brightness: 150.0, }, EnvironmentMapLight { diffuse_map: skybox_handle.clone(), diff --git a/src/hit.rs b/src/hit.rs index 5db487a..7f0842e 100644 --- a/src/hit.rs +++ b/src/hit.rs @@ -22,8 +22,10 @@ impl Triangle { } fn normal_plane(&self) -> Plane3d { - Plane3d { - normal: Direction3d::new(self.normal()).expect("Valid normal direction"), + // HACK: This should just be `try_from_points` or `try_new` + match Direction3d::new((self.v1 - self.v0).cross(self.v2 - self.v0)) { + Ok(normal) => Plane3d { normal }, + Err(_) => Plane3d::default(), } } diff --git a/src/prelude.rs b/src/prelude.rs index f271584..2d6f34a 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -11,32 +11,22 @@ pub(crate) use bevy::{ tonemapping::{DebandDither, Tonemapping}, Skybox, }, - diagnostic::{ - DiagnosticsStore, EntityCountDiagnosticsPlugin, FrameTimeDiagnosticsPlugin, - SystemInformationDiagnosticsPlugin, - }, + diagnostic::*, gltf::Gltf, input::{ keyboard::KeyboardInput, - mouse::{MouseButtonInput, MouseMotion, MouseScrollUnit, MouseWheel}, + mouse::*, ButtonState, }, - pbr::{ - ScreenSpaceAmbientOcclusionQualityLevel, - ExtendedMaterial, MaterialExtension, ScreenSpaceAmbientOcclusionBundle, - ScreenSpaceAmbientOcclusionSettings, - }, + pbr::*, prelude::*, reflect::TypePath, render::{ - mesh::{MeshVertexAttribute, VertexAttributeValues}, - render_resource::{ - AsBindGroup, ShaderRef, TextureViewDescriptor, TextureViewDimension, VertexFormat, - }, - view::ColorGrading, + mesh::*, + render_resource::*, + view::*, }, - utils::BoxedFuture, - utils::{hashbrown::hash_map::Iter, HashMap, HashSet}, + utils::{hashbrown::hash_map::Iter, HashMap, HashSet, BoxedFuture}, window::PrimaryWindow, winit::WinitWindows, };