pub struct ClimateSimulator {
pub latitude_range: (f32, f32),
pub base_temperature: f32,
pub precipitation_scale: f32,
pub wind_direction: (f32, f32),
}Expand description
Simulates climate across a terrain given a heightmap.
Models temperature gradients, Hadley/Ferrel circulation cells, rain shadow from mountains, and ocean current effects.
Fields§
§latitude_range: (f32, f32)World latitude range [south, north] in degrees.
base_temperature: f32Global temperature offset in normalized units.
precipitation_scale: f32Global precipitation scale factor.
wind_direction: (f32, f32)Prevailing wind direction (normalized x, z).
Implementations§
Source§impl ClimateSimulator
impl ClimateSimulator
pub fn new() -> Self
Sourcepub fn temperature(&self, nx: f32, ny: f32, altitude: f32) -> f32
pub fn temperature(&self, nx: f32, ny: f32, altitude: f32) -> f32
Compute temperature at a given normalized position (x, y in [0,1]) and altitude.
Sourcepub fn precipitation(
&self,
nx: f32,
ny: f32,
altitude: f32,
heightmap: &HeightMap,
) -> f32
pub fn precipitation( &self, nx: f32, ny: f32, altitude: f32, heightmap: &HeightMap, ) -> f32
Compute precipitation at a given position, accounting for rain shadow.
Sourcepub fn ocean_current_effect(&self, nx: f32, ny: f32) -> f32
pub fn ocean_current_effect(&self, nx: f32, ny: f32) -> f32
Compute ocean current warming/cooling effect at a coastal point.
Sourcepub fn simulate(&self, heightmap: &HeightMap) -> ClimateMap
pub fn simulate(&self, heightmap: &HeightMap) -> ClimateMap
Generate a full ClimateMap from a heightmap.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClimateSimulator
impl RefUnwindSafe for ClimateSimulator
impl Send for ClimateSimulator
impl Sync for ClimateSimulator
impl Unpin for ClimateSimulator
impl UnsafeUnpin for ClimateSimulator
impl UnwindSafe for ClimateSimulator
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> 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.