pub struct Atmosphere {
pub config: AtmosphereConfig,
pub layers: Vec<AtmosphericLayer>,
pub temperature_profile: TemperatureProfile,
pub humidity_map: HumidityMap,
pub wind_field: WindField,
pub pressure_cells: Vec<PressureCell>,
pub jet_streams: Vec<JetStream>,
pub fog_layers: Vec<FogLayer>,
pub surface_altitude_m: f32,
pub haze_extinction: f32,
/* private fields */
}Expand description
The primary atmospheric simulation state.
Fields§
§config: AtmosphereConfig§layers: Vec<AtmosphericLayer>§temperature_profile: TemperatureProfile§humidity_map: HumidityMap§wind_field: WindField§pressure_cells: Vec<PressureCell>§jet_streams: Vec<JetStream>§fog_layers: Vec<FogLayer>§surface_altitude_m: f32§haze_extinction: f32Background aerosol extinction (haze), m⁻¹.
Implementations§
Source§impl Atmosphere
impl Atmosphere
pub fn new(surface_altitude_m: f32) -> Self
pub fn with_config(surface_altitude_m: f32, config: AtmosphereConfig) -> Self
pub fn tick(&mut self, dt: f32, surface_temp_k: f32, time_of_day: f32)
Sourcepub fn surface_humidity(&self) -> f32
pub fn surface_humidity(&self) -> f32
Return surface (layer 0) relative humidity [0,1].
Sourcepub fn surface_pressure(&self) -> f32
pub fn surface_pressure(&self) -> f32
Return surface pressure (Pa).
Sourcepub fn surface_wind(&self) -> Vec3
pub fn surface_wind(&self) -> Vec3
Return surface wind velocity (m/s).
Sourcepub fn wind_at(&self, wx: f32, wy: f32, wz: f32) -> [f32; 3]
pub fn wind_at(&self, wx: f32, wy: f32, wz: f32) -> [f32; 3]
Sample wind at world-space position.
Sourcepub fn compute_visibility(&self) -> VisibilityResult
pub fn compute_visibility(&self) -> VisibilityResult
Compute meteorological visibility from the surface.
Sourcepub fn cloud_fraction_at(&self, alt_m: f32) -> f32
pub fn cloud_fraction_at(&self, alt_m: f32) -> f32
Return the cloud fraction at a given altitude.
Sourcepub fn optical_depth_between(&self, alt_low: f32, alt_high: f32) -> f32
pub fn optical_depth_between(&self, alt_low: f32, alt_high: f32) -> f32
Integrate optical depth between two altitudes (for sky rendering).
Sourcepub fn temperature_at(&self, alt_m: f32) -> f32
pub fn temperature_at(&self, alt_m: f32) -> f32
Return temperature (K) at world altitude.
Trait Implementations§
Source§impl Clone for Atmosphere
impl Clone for Atmosphere
Source§fn clone(&self) -> Atmosphere
fn clone(&self) -> Atmosphere
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 Atmosphere
impl RefUnwindSafe for Atmosphere
impl Send for Atmosphere
impl Sync for Atmosphere
impl Unpin for Atmosphere
impl UnsafeUnpin for Atmosphere
impl UnwindSafe for Atmosphere
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.