Struct LightEnv

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

Lighting environment, passed as one of the fragment stages.

A LightEnv is comprised of 8 different lights governed by the same lighting algorithm.

Implementations§

Source§

impl LightEnv

Source

pub fn new_pinned() -> Pin<Box<LightEnv>>

Constructs a new lighting environment.

Due to the internal representation of a lighting environment, the lighting environment and the various lights are all pinned objects.

Source

pub fn set_material(self: Pin<&mut Self>, mat: Material)

Setup the environment material.

This material is inherited by all internal lights.

Source

pub fn lights(&self) -> &PinArray<Option<Light>, NB_LIGHTS>

Returns a reference to the array of (pinned) lights.

Source

pub fn lights_mut( self: Pin<&mut Self>, ) -> Pin<&mut PinArray<Option<Light>, NB_LIGHTS>>

Returns a mutable reference to the array of (pinned) lights.

Source

pub fn light_mut( self: Pin<&mut Self>, idx: LightIndex, ) -> Option<Pin<&mut Light>>

Returns a mutable reference to the light at a particular index.

Source

pub fn create_light(self: Pin<&mut Self>) -> Option<LightIndex>

Sets up a new light source and returns its index for use.

If no more light sources can be created, [None] is returned.

Source

pub fn destroy_light(self: Pin<&mut Self>, idx: LightIndex)

Uninitalizes and disables the light at a specific index.

Source

pub fn disconnect_lut( self: Pin<&mut Self>, id: LutId, input: LutInput, ) -> Option<Lut>

Attempts to disconnect a light lookup-table.

This function returns [None] if no LUT was connected for id and input. Otherwise, returns the disconnected LUT.

Source

pub fn connect_lut(self: Pin<&mut Self>, id: LutId, input: LutInput, data: Lut)

Connects a light lookup-table at the given index, with a given input.

Source

pub fn set_fresnel(self: Pin<&mut Self>, sel: FresnelSelector)

Sets the fresnel for the lighting environment.

Source

pub fn as_raw(&self) -> &C3D_LightEnv

Returns a reference to the raw Citro3D representation.

Source

pub fn as_raw_mut(self: Pin<&mut Self>) -> &mut C3D_LightEnv

Returns a mutable reference to the raw Citro3D representation.

Auto Trait Implementations§

§

impl Freeze for LightEnv

§

impl RefUnwindSafe for LightEnv

§

impl !Send for LightEnv

§

impl !Sync for LightEnv

§

impl !Unpin for LightEnv

§

impl UnwindSafe for LightEnv

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.