pub struct LocalLight {
pub position: [f32; 3],
pub colour: [f32; 3],
pub intensity: f32,
pub radius: f32,
pub range: f32,
pub shadow: bool,
pub shape: LightShape,
}Fields§
§position: [f32; 3]§colour: [f32; 3]§intensity: f32§radius: f32§range: f32§shadow: bool§shape: LightShapeImplementations§
Source§impl LocalLight
impl LocalLight
pub fn point( position: [f32; 3], colour: [f32; 3], intensity: f32, range: f32, ) -> Self
pub fn rect( centre: [f32; 3], half_u: [f32; 3], half_v: [f32; 3], colour: [f32; 3], intensity: f32, ) -> Self
pub fn disc( centre: [f32; 3], normal: [f32; 3], radius: f32, colour: [f32; 3], intensity: f32, ) -> Self
pub fn lit(&self) -> bool
pub fn valid(&self) -> bool
pub fn area(&self) -> f32
pub fn falloff(&self, distance: f32) -> f32
pub fn cone(&self, toward_surface: [f32; 3]) -> f32
Trait Implementations§
Source§impl Clone for LocalLight
impl Clone for LocalLight
Source§fn clone(&self) -> LocalLight
fn clone(&self) -> LocalLight
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LocalLight
impl Debug for LocalLight
Source§impl PartialEq for LocalLight
impl PartialEq for LocalLight
Source§fn eq(&self, other: &LocalLight) -> bool
fn eq(&self, other: &LocalLight) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for LocalLight
impl StructuralPartialEq for LocalLight
Auto Trait Implementations§
impl Freeze for LocalLight
impl RefUnwindSafe for LocalLight
impl Send for LocalLight
impl Sync for LocalLight
impl Unpin for LocalLight
impl UnsafeUnpin for LocalLight
impl UnwindSafe for LocalLight
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.