pub struct DayNightCycle {
pub time_of_day: f32,
pub day_duration: f32,
pub day_count: u32,
pub speed: f32,
pub paused: bool,
}Expand description
Full day/night cycle state.
Fields§
§time_of_day: f32Time of day in range [0, 1) — 0=midnight, 0.25=6am, 0.5=noon, 0.75=6pm.
day_duration: f32Duration of a full day in real seconds.
day_count: u32Current day number.
speed: f32Speed multiplier (1.0 = real-time).
paused: boolImplementations§
Source§impl DayNightCycle
impl DayNightCycle
pub fn new(day_duration: f32) -> Self
pub fn tick(&mut self, dt: f32)
pub fn is_daytime(&self) -> bool
pub fn is_dawn(&self) -> bool
pub fn is_dusk(&self) -> bool
pub fn is_night(&self) -> bool
Sourcepub fn sun_direction(&self) -> Vec3
pub fn sun_direction(&self) -> Vec3
Sun direction (Vec3, normalized).
Sourcepub fn moon_direction(&self) -> Vec3
pub fn moon_direction(&self) -> Vec3
Moon direction (opposite of sun, slightly offset).
Sourcepub fn ambient_intensity(&self) -> f32
pub fn ambient_intensity(&self) -> f32
Ambient light intensity (0–1).
Sourcepub fn sun_intensity(&self) -> f32
pub fn sun_intensity(&self) -> f32
Sun light intensity.
pub fn set_hour(&mut self, h: f32)
Trait Implementations§
Source§impl Clone for DayNightCycle
impl Clone for DayNightCycle
Source§fn clone(&self) -> DayNightCycle
fn clone(&self) -> DayNightCycle
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 DayNightCycle
impl Debug for DayNightCycle
Auto Trait Implementations§
impl Freeze for DayNightCycle
impl RefUnwindSafe for DayNightCycle
impl Send for DayNightCycle
impl Sync for DayNightCycle
impl Unpin for DayNightCycle
impl UnsafeUnpin for DayNightCycle
impl UnwindSafe for DayNightCycle
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