diff --git a/lyra-game/src/render/light/mod.rs b/lyra-game/src/render/light/mod.rs index 9135632..91b9ee6 100644 --- a/lyra-game/src/render/light/mod.rs +++ b/lyra-game/src/render/light/mod.rs @@ -12,8 +12,6 @@ use crate::math::Transform; use self::directional::DirectionalLight; -use super::render_buffer::BindGroupPair; - const MAX_LIGHT_COUNT: usize = 16; /// A struct that stores a list of lights in a wgpu::Buffer. diff --git a/lyra-resource/Cargo.toml b/lyra-resource/Cargo.toml index 9e5e149..51b160d 100644 --- a/lyra-resource/Cargo.toml +++ b/lyra-resource/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] lyra-ecs = { path = "../lyra-ecs", features = [ "math" ] } -lyra-reflect = { path = "../lyra-reflect" } +lyra-reflect = { path = "../lyra-reflect", features = [ "math" ] } lyra-math = { path = "../lyra-math" } lyra-scene = { path = "../lyra-scene" } anyhow = "1.0.75" diff --git a/lyra-resource/src/gltf/material.rs b/lyra-resource/src/gltf/material.rs index 3a24d9d..372d7ee 100644 --- a/lyra-resource/src/gltf/material.rs +++ b/lyra-resource/src/gltf/material.rs @@ -34,10 +34,10 @@ impl From> for PbrRoughness { #[derive(Clone, Debug, Default, Reflect)] pub struct PbrGlossiness { /// The rgba diffuse color of the material - pub diffuse_color: glam::Vec4, + pub diffuse_color: lyra_math::Vec4, // The base color texture // pub diffuse_texture // TODO - pub specular: glam::Vec3, + pub specular: lyra_math::Vec3, /// The glossiness factor of the material. /// From 0.0 (no glossiness) to 1.0 (full glossiness) pub glossiness: f32, @@ -101,7 +101,7 @@ pub struct Specular { pub factor: f32, /// The color of the specular reflection - pub color_factor: glam::Vec3, + pub color_factor: lyra_math::Vec3, /// A texture that defines the strength of the specular reflection, /// stored in the alpha (`A`) channel. This will be multiplied by @@ -140,7 +140,7 @@ pub struct Material { //pub pbr_roughness: PbrRoughness, /// The RGBA base color of the model. If a texture is supplied with `base_color_texture`, this value /// will tint the texture. If a texture is not provided, this value would be the color of the Material. - pub base_color: glam::Vec4, + pub base_color: lyra_math::Vec4, /// The metalness of the material /// From 0.0 (non-metal) to 1.0 (metal) pub metallic: f32, diff --git a/lyra-resource/src/gltf/mesh.rs b/lyra-resource/src/gltf/mesh.rs index a23affe..3cddd3c 100644 --- a/lyra-resource/src/gltf/mesh.rs +++ b/lyra-resource/src/gltf/mesh.rs @@ -50,9 +50,9 @@ impl From> for MeshIndices { #[repr(C)] #[derive(Clone, Debug, PartialEq, Reflect)] pub enum VertexAttributeData { - Vec2(Vec), - Vec3(Vec), - Vec4(Vec), + Vec2(Vec), + Vec3(Vec), + Vec4(Vec), } impl VertexAttributeData { diff --git a/lyra-resource/src/resource_manager.rs b/lyra-resource/src/resource_manager.rs index 4d2f0ba..99e01b0 100644 --- a/lyra-resource/src/resource_manager.rs +++ b/lyra-resource/src/resource_manager.rs @@ -374,7 +374,7 @@ pub(crate) mod tests { use instant::Instant; - use crate::{Image, ResourceData, Texture}; + use crate::{Image, ResourceData}; use super::*; @@ -431,10 +431,10 @@ pub(crate) mod tests { #[test] fn ensure_single() { let man = ResourceManager::new(); - let res = man.request::(&get_image("squiggles.png")).unwrap(); + let res = man.request::(&get_image("squiggles.png")).unwrap(); assert_eq!(Arc::strong_count(&res.handle.res), 3); - let resagain = man.request::(&get_image("squiggles.png")).unwrap(); + let resagain = man.request::(&get_image("squiggles.png")).unwrap(); assert_eq!(Arc::strong_count(&resagain.handle.res), 4); } @@ -442,7 +442,7 @@ pub(crate) mod tests { #[test] fn ensure_none() { let man = ResourceManager::new(); - let res = man.request::(&get_image("squigglesfff.png")).unwrap(); + let res = man.request::(&get_image("squigglesfff.png")).unwrap(); //let err = res.err().unwrap(); // 1 second should be enough to run into an error @@ -468,7 +468,7 @@ pub(crate) mod tests { #[test] fn reload_image() { let man = ResourceManager::new(); - let res = man.request::(&get_image("squiggles.png")).unwrap(); + let res = man.request::(&get_image("squiggles.png")).unwrap(); busy_wait_resource(&res, 10.0); let img = res.data_ref(); img.unwrap(); @@ -489,7 +489,7 @@ pub(crate) mod tests { std::fs::copy(orig_path, &image_path).unwrap(); let man = ResourceManager::new(); - let res = man.request::(&image_path).unwrap(); + let res = man.request::(&image_path).unwrap(); busy_wait_resource(&res, 10.0); let img = res.data_ref(); img.unwrap();