Struct pix_engine::lighting::Light
source · pub struct Light<T = f64, const N: usize = 3> {
pub source: LightSource<T, N>,
pub intensity: T,
}
Expand description
Light
representation including source
and intensity
.
Fields§
§source: LightSource<T, N>
Source of light.
intensity: T
Light intensity.
Implementations§
source§impl<T, const N: usize> Light<T, N>
impl<T, const N: usize> Light<T, N>
sourcepub const fn new(source: LightSource<T, N>, intensity: T) -> Self
pub const fn new(source: LightSource<T, N>, intensity: T) -> Self
Constructs a new Light
.
sourcepub const fn ambient(intensity: T) -> Self
pub const fn ambient(intensity: T) -> Self
Constructs a Light
with source
as LightSource::Ambient
.
sourcepub fn point<P>(intensity: T, position: P) -> Self
pub fn point<P>(intensity: T, position: P) -> Self
Constructs a Light
with source
as LightSource::Point
.
sourcepub fn direction<V>(intensity: T, direction: V) -> Self
pub fn direction<V>(intensity: T, direction: V) -> Self
Constructs a Light
with source as LightSource::Direction
.
Trait Implementations§
source§impl<'de, T, const N: usize> Deserialize<'de> for Light<T, N>where
T: Serialize + DeserializeOwned,
impl<'de, T, const N: usize> Deserialize<'de> for Light<T, N>where
T: Serialize + DeserializeOwned,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: PartialEq, const N: usize> PartialEq for Light<T, N>
impl<T: PartialEq, const N: usize> PartialEq for Light<T, N>
impl<T: Copy, const N: usize> Copy for Light<T, N>
impl<T: Eq, const N: usize> Eq for Light<T, N>
impl<T, const N: usize> StructuralEq for Light<T, N>
impl<T, const N: usize> StructuralPartialEq for Light<T, N>
Auto Trait Implementations§
impl<T, const N: usize> RefUnwindSafe for Light<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Light<T, N>where
T: Send,
impl<T, const N: usize> Sync for Light<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for Light<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for Light<T, N>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more