Struct Light

Source
pub struct Light { /* private fields */ }
Expand description

Light source, used by a LightEnv.

Lights can be simple omnidirectional point lights or setup with a directional spotlight effect.

Implementations§

Source§

impl Light

Source

pub fn as_raw(&self) -> &C3D_Light

Returns a reference to the raw Citro3D representation.

Source

pub fn as_raw_mut(&mut self) -> &mut C3D_Light

Returns a mutable reference to the raw Citro3D representation.

§Notes

This does not take Pin<&mut Self> and rather borrows the value directly. If you need the raw from a pinned light you must use unsafe and ensure you uphold the pinning restrictions of the original Light.

Source

pub fn set_position(self: Pin<&mut Self>, p: FVec3)

Sets the position, in 3D space, of the light source.

Source

pub fn set_color(self: Pin<&mut Self>, color: Color)

Sets the color of the light source.

Source

pub fn set_enabled(self: Pin<&mut Self>, enabled: bool)

Enables/disables the light source.

Source

pub fn set_shadow(self: Pin<&mut Self>, shadow: bool)

Enables/disables the light source’s shadow emission.

Source

pub fn set_distance_attenutation( self: Pin<&mut Self>, lut: Option<DistanceAttenuation>, )

Sets the distance attenuation behaviour of the light.

Source

pub fn set_spotlight(self: Pin<&mut Self>, lut: Option<Spotlight>)

Sets the spotlight behaviour of the light.

Source

pub fn set_spotlight_direction(self: Pin<&mut Self>, direction: FVec3)

Sets the spotlight direction of the light (relatively to the light’s source position).

Auto Trait Implementations§

§

impl Freeze for Light

§

impl RefUnwindSafe for Light

§

impl !Send for Light

§

impl !Sync for Light

§

impl !Unpin for Light

§

impl UnwindSafe for Light

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.