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: TLight 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
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> StructuralPartialEq for Light<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Light<T, N>where
T: Freeze,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.