pub struct WeatherPattern {
pub kind: WeatherPatternKind,
pub centre: [f32; 2],
pub radius: f32,
pub intensity: f32,
pub drift: [f32; 2],
pub lifetime: f32,
pub pressure_anomaly_pa: f32,
pub temp_anomaly_c: f32,
pub precip_modifier: f32,
}Expand description
A large-scale weather pattern.
Fields§
§kind: WeatherPatternKind§centre: [f32; 2]Position of the pattern centre (world x, z).
radius: f32Radius of influence (m).
intensity: f32Pattern intensity [0,1].
drift: [f32; 2]Drift velocity (m/s).
lifetime: f32Remaining lifetime (seconds).
pressure_anomaly_pa: f32Associated pressure anomaly (Pa, positive = high, negative = low).
temp_anomaly_c: f32Associated temperature anomaly (°C).
precip_modifier: f32Associated precipitation modifier [0,2]; 1 = no change.
Implementations§
Source§impl WeatherPattern
impl WeatherPattern
pub fn new_high_pressure(cx: f32, cz: f32) -> Self
pub fn new_low_pressure(cx: f32, cz: f32) -> Self
pub fn new_monsoon(cx: f32, cz: f32) -> Self
pub fn tick(&mut self, dt: f32)
Sourcepub fn temp_influence(&self, x: f32, z: f32) -> f32
pub fn temp_influence(&self, x: f32, z: f32) -> f32
Influence on temperature at world position.
Sourcepub fn precip_influence(&self, x: f32, z: f32) -> f32
pub fn precip_influence(&self, x: f32, z: f32) -> f32
Influence on precipitation multiplier at world position.
pub fn is_alive(&self) -> bool
Trait Implementations§
Source§impl Clone for WeatherPattern
impl Clone for WeatherPattern
Source§fn clone(&self) -> WeatherPattern
fn clone(&self) -> WeatherPattern
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 moreAuto Trait Implementations§
impl Freeze for WeatherPattern
impl RefUnwindSafe for WeatherPattern
impl Send for WeatherPattern
impl Sync for WeatherPattern
impl Unpin for WeatherPattern
impl UnsafeUnpin for WeatherPattern
impl UnwindSafe for WeatherPattern
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.