diff options
author | Silas Bartha <[email protected]> | 2024-11-26 16:32:19 -0500 |
---|---|---|
committer | Silas Bartha <[email protected]> | 2024-11-26 16:32:19 -0500 |
commit | 8b5a8ce1efeedb4333e8f10364f6b916bd10c5d9 (patch) | |
tree | 97d2f93b3f942b934e58436f67d771a15168f9c8 /src | |
parent | afa8cad4cf778673633f95885f5da095ba96039f (diff) |
Tue Nov 26 04:32:19 PM EST 2024
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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>>, + blacklight_query: Query<(&ViewVisibility, &GlobalTransform, &SpotLight), With<Blacklight>>, blacklight_material_query: Query<&Handle<BlacklightMaterial>>, mut blacklight_materials: ResMut<Assets<BlacklightMaterial>>, ) { 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::<Vec<_>>(); for handle in blacklight_material_query.iter() { |