pub struct LightEnv { /* private fields */ }Expand description
Implementations§
Source§impl LightEnv
impl LightEnv
Sourcepub fn new_pinned() -> Pin<Box<LightEnv>>
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.
Sourcepub fn set_material(self: Pin<&mut Self>, mat: Material)
pub fn set_material(self: Pin<&mut Self>, mat: Material)
Setup the environment material.
This material is inherited by all internal lights.
Sourcepub fn lights(&self) -> &PinArray<Option<Light>, NB_LIGHTS>
pub fn lights(&self) -> &PinArray<Option<Light>, NB_LIGHTS>
Returns a reference to the array of (pinned) lights.
Sourcepub fn lights_mut(
self: Pin<&mut Self>,
) -> Pin<&mut PinArray<Option<Light>, NB_LIGHTS>>
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.
Sourcepub fn light_mut(
self: Pin<&mut Self>,
idx: LightIndex,
) -> Option<Pin<&mut Light>>
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.
Sourcepub fn create_light(self: Pin<&mut Self>) -> Option<LightIndex>
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.
Sourcepub fn destroy_light(self: Pin<&mut Self>, idx: LightIndex)
pub fn destroy_light(self: Pin<&mut Self>, idx: LightIndex)
Uninitalizes and disables the light at a specific index.
Sourcepub fn disconnect_lut(
self: Pin<&mut Self>,
id: LutId,
input: LutInput,
) -> Option<Lut>
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.
Sourcepub fn connect_lut(self: Pin<&mut Self>, id: LutId, input: LutInput, data: Lut)
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.
Sourcepub fn set_fresnel(self: Pin<&mut Self>, sel: FresnelSelector)
pub fn set_fresnel(self: Pin<&mut Self>, sel: FresnelSelector)
Sets the fresnel for the lighting environment.
Sourcepub fn as_raw(&self) -> &C3D_LightEnv
pub fn as_raw(&self) -> &C3D_LightEnv
Returns a reference to the raw Citro3D representation.
Sourcepub fn as_raw_mut(self: Pin<&mut Self>) -> &mut C3D_LightEnv
pub fn as_raw_mut(self: Pin<&mut Self>) -> &mut C3D_LightEnv
Returns a mutable reference to the raw Citro3D representation.