
# Objective - make lights usable without bevy_render ## Solution - make a new crate for lights to live in ## Testing - 3d_scene, lighting, volumetric_fog, ssr, transmission, pcss, light_textures Note: no breaking changes because of re-exports, except for light textures, which were introduced this cycle so it doesn't matter anyways
42 lines
1.1 KiB
Rust
42 lines
1.1 KiB
Rust
//! This module exists because of the orphan rule
|
|
|
|
use bevy_ecs::query::QueryItem;
|
|
use bevy_light::{cluster::ClusteredDecal, AmbientLight, ShadowFilteringMethod};
|
|
|
|
use crate::{extract_component::ExtractComponent, extract_resource::ExtractResource};
|
|
|
|
impl ExtractComponent for ClusteredDecal {
|
|
type QueryData = &'static Self;
|
|
type QueryFilter = ();
|
|
type Out = Self;
|
|
|
|
fn extract_component(item: QueryItem<Self::QueryData>) -> Option<Self::Out> {
|
|
Some(item.clone())
|
|
}
|
|
}
|
|
impl ExtractResource for AmbientLight {
|
|
type Source = Self;
|
|
|
|
fn extract_resource(source: &Self::Source) -> Self {
|
|
source.clone()
|
|
}
|
|
}
|
|
impl ExtractComponent for AmbientLight {
|
|
type QueryData = &'static Self;
|
|
type QueryFilter = ();
|
|
type Out = Self;
|
|
|
|
fn extract_component(item: QueryItem<Self::QueryData>) -> Option<Self::Out> {
|
|
Some(item.clone())
|
|
}
|
|
}
|
|
impl ExtractComponent for ShadowFilteringMethod {
|
|
type QueryData = &'static Self;
|
|
type QueryFilter = ();
|
|
type Out = Self;
|
|
|
|
fn extract_component(item: QueryItem<Self::QueryData>) -> Option<Self::Out> {
|
|
Some(*item)
|
|
}
|
|
}
|