pub struct IESProfile {
pub vertical_angles: Vec<f32>,
pub horizontal_angles: Vec<f32>,
pub candela_values: Vec<f32>,
pub max_candela: f32,
pub position: Vec3,
pub direction: Vec3,
pub color: Color,
pub intensity: f32,
pub radius: f32,
pub enabled: bool,
}Expand description
Photometric intensity distribution sampled from IES data. Uses bilinear interpolation on a 2D (vertical angle, horizontal angle) grid.
Fields§
§vertical_angles: Vec<f32>Vertical angles in radians (typically 0 to PI).
horizontal_angles: Vec<f32>Horizontal angles in radians (typically 0 to 2*PI).
candela_values: Vec<f32>Candela values: indexed as [h_index * vertical_count + v_index].
max_candela: f32Maximum candela value for normalization.
position: Vec3Light properties
direction: Vec3§color: Color§intensity: f32§radius: f32§enabled: boolImplementations§
Source§impl IESProfile
impl IESProfile
Sourcepub fn new(
vertical_angles: Vec<f32>,
horizontal_angles: Vec<f32>,
candela_values: Vec<f32>,
position: Vec3,
direction: Vec3,
) -> Self
pub fn new( vertical_angles: Vec<f32>, horizontal_angles: Vec<f32>, candela_values: Vec<f32>, position: Vec3, direction: Vec3, ) -> Self
Create an IES profile from raw data.
Sourcepub fn symmetric(
vertical_angles: Vec<f32>,
candela_values: Vec<f32>,
position: Vec3,
direction: Vec3,
) -> Self
pub fn symmetric( vertical_angles: Vec<f32>, candela_values: Vec<f32>, position: Vec3, direction: Vec3, ) -> Self
Create a symmetric IES profile from vertical-only data.
Sourcepub fn vertical_count(&self) -> usize
pub fn vertical_count(&self) -> usize
Get the number of vertical angle samples.
Sourcepub fn horizontal_count(&self) -> usize
pub fn horizontal_count(&self) -> usize
Get the number of horizontal angle samples.
Sourcepub fn sample(&self, vertical_angle: f32, horizontal_angle: f32) -> f32
pub fn sample(&self, vertical_angle: f32, horizontal_angle: f32) -> f32
Sample the candela value at the given vertical and horizontal angles using bilinear interpolation.
Sourcepub fn intensity_for_direction(&self, world_dir: Vec3) -> f32
pub fn intensity_for_direction(&self, world_dir: Vec3) -> f32
Compute the normalized intensity factor for a world-space direction.
Sourcepub fn irradiance_at(&self, point: Vec3) -> Color
pub fn irradiance_at(&self, point: Vec3) -> Color
Compute irradiance at a world position.
Trait Implementations§
Source§impl Clone for IESProfile
impl Clone for IESProfile
Source§fn clone(&self) -> IESProfile
fn clone(&self) -> IESProfile
Returns a duplicate of the value. Read more
1.0.0 · 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 IESProfile
impl Debug for IESProfile
Auto Trait Implementations§
impl Freeze for IESProfile
impl RefUnwindSafe for IESProfile
impl Send for IESProfile
impl Sync for IESProfile
impl Unpin for IESProfile
impl UnsafeUnpin for IESProfile
impl UnwindSafe for IESProfile
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.