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: 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) -> Selfwhere
P: Into<Point<T, N>>,
pub fn point<P>(intensity: T, position: P) -> Selfwhere
P: Into<Point<T, N>>,
Constructs a Light with source as LightSource::Point.
sourcepub fn direction<V>(intensity: T, direction: V) -> Selfwhere
V: Into<Vector<T, N>>,
pub fn direction<V>(intensity: T, direction: V) -> Selfwhere
V: Into<Vector<T, N>>,
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<Light<T, N>> for Light<T, N>
impl<T: PartialEq, const N: usize> PartialEq<Light<T, N>> 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§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more