From 8b5a8ce1efeedb4333e8f10364f6b916bd10c5d9 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Tue, 26 Nov 2024 16:32:19 -0500 Subject: Tue Nov 26 04:32:19 PM EST 2024 --- src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 65dfc80..282c9b0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,9 +20,9 @@ pub struct Blacklight; pub struct BlacklightData { pub position: Vec3, pub direction: Vec3, - pub color: Vec4, pub range: f32, - pub radius: f32, + pub inner_angle: f32, + pub outer_angle: f32, } #[derive(Asset, TypePath, AsBindGroup, Debug, Clone)] @@ -56,19 +56,19 @@ impl Material for BlacklightMaterial { } fn update_shader_blacklight_data( - blacklight_query: Query<(&ViewVisibility, &GlobalTransform, &Transform, &SpotLight), With>, + blacklight_query: Query<(&ViewVisibility, &GlobalTransform, &SpotLight), With>, blacklight_material_query: Query<&Handle>, mut blacklight_materials: ResMut>, ) { let light_data = blacklight_query .iter() - .filter(|(visibility, _, _, _)| visibility.get()) - .map(|(_, global_transform, transform, light)| BlacklightData { + .filter(|(visibility, _, _)| visibility.get()) + .map(|(_, global_transform, light)| BlacklightData { position: global_transform.translation(), direction: *global_transform.forward(), - color: light.color.to_srgba().to_vec4(), range: light.range, - radius: light.radius, + inner_angle: light.inner_angle, + outer_angle: light.outer_angle, }) .collect::>(); for handle in blacklight_material_query.iter() { -- cgit v1.2.3