pub struct ViewerSettings {Show 16 fields
pub scene_type: SceneType,
pub room_width: f32,
pub room_length: f32,
pub room_height: f32,
pub mounting_height: f32,
pub pendulum_length: f32,
pub light_intensity: f32,
pub show_luminaire: bool,
pub show_photometric_solid: bool,
pub show_shadows: bool,
pub ldt_data: Option<Eulumdat>,
pub luminaire_tilt: f32,
pub lane_width: f32,
pub num_lanes: u32,
pub sidewalk_width: f32,
pub pole_spacing: f32,
}Expand description
Global viewer settings resource.
This resource controls the viewer’s behavior and appearance. Changes to this resource trigger reactive updates to the scene.
Fields§
§scene_type: SceneTypeCurrent scene type
room_width: f32Room/scene width in meters (X axis)
room_length: f32Room/scene length in meters (Z axis)
room_height: f32Room height in meters (Y axis, only for Room scene)
mounting_height: f32Luminaire mounting height in meters (for outdoor poles) For indoor scenes, this is ignored - use pendulum_length instead
pendulum_length: f32Pendulum/suspension length in meters (for indoor ceiling-mounted luminaires) 0.0 = flush mounted to ceiling
0.0 = hangs down from ceiling by this amount
light_intensity: f32Light intensity (not used directly, available for UI)
show_luminaire: boolWhether to show the luminaire model
show_photometric_solid: boolWhether to show the photometric solid
show_shadows: boolWhether to enable shadows
ldt_data: Option<Eulumdat>The LDT data to display
luminaire_tilt: f32Luminaire tilt angle in degrees (for road/outdoor scenes). 0 = pointing straight down, 90 = pointing horizontally across the road. Default is 15 degrees for road luminaires.
lane_width: f32Lane width in meters (for road scenes). Default 3.5m per EN 13201.
num_lanes: u32Number of lanes (for road scenes). Default 2 (one per direction).
sidewalk_width: f32Sidewalk width in meters. Default 2.0m.
pole_spacing: f32Pole spacing in meters. Calculated based on mounting height if 0. Typical: 3-4x mounting height for good uniformity.
Implementations§
Source§impl ViewerSettings
impl ViewerSettings
Sourcepub fn effective_pole_spacing(&self) -> f32
pub fn effective_pole_spacing(&self) -> f32
Calculate effective pole spacing. If pole_spacing is 0, use 3.5x mounting height (good uniformity).
Sourcepub fn total_road_width(&self) -> f32
pub fn total_road_width(&self) -> f32
Calculate total road width including sidewalks.
Source§impl ViewerSettings
impl ViewerSettings
Sourcepub fn luminaire_height(&self, ldt: &Eulumdat) -> f32
pub fn luminaire_height(&self, ldt: &Eulumdat) -> f32
Calculate the effective luminaire center height for the current scene.
For Room scenes:
- Luminaire hangs from ceiling by pendulum_length
- Center Y = room_height - pendulum_length - half_luminaire_height
For outdoor scenes (Road, Parking, Outdoor):
- Luminaire is fixed to pole arm at mounting_height
- Center Y = mounting_height - arm_offset - half_luminaire_height
Sourcepub fn attachment_height(&self) -> f32
pub fn attachment_height(&self) -> f32
Get the attachment point height (where pendulum/cable starts). Only meaningful for Room scene.
Trait Implementations§
Source§impl Clone for ViewerSettings
impl Clone for ViewerSettings
Source§fn clone(&self) -> ViewerSettings
fn clone(&self) -> ViewerSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ViewerSettings
impl Default for ViewerSettings
impl Resource for ViewerSettings
Auto Trait Implementations§
impl Freeze for ViewerSettings
impl RefUnwindSafe for ViewerSettings
impl Send for ViewerSettings
impl Sync for ViewerSettings
impl Unpin for ViewerSettings
impl UnsafeUnpin for ViewerSettings
impl UnwindSafe for ViewerSettings
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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
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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more