pub struct StormFront {
pub kind: WeatherPatternKind,
pub origin: [f32; 2],
pub direction: f32,
pub speed: f32,
pub width: f32,
pub length: f32,
pub age: f32,
pub max_lifetime: f32,
pub temp_gradient_c: f32,
pub leading_precip: f32,
pub trailing_precip: f32,
pub occluded: bool,
}Expand description
A weather front — boundary between air masses.
Fields§
§kind: WeatherPatternKind§origin: [f32; 2]Origin point in world (x, z).
direction: f32Direction of movement (radians).
speed: f32Speed (m/s).
width: f32Half-width of the frontal zone (m).
length: f32Length of the front (m).
age: f32Age (seconds).
max_lifetime: f32Maximum lifetime (seconds).
temp_gradient_c: f32Temperature change across the front (°C, positive = warmer air behind).
leading_precip: f32Precipitation intensity on the leading edge [0,1].
trailing_precip: f32Precipitation intensity on the trailing edge [0,1].
occluded: boolWhether the front has become occluded.
Implementations§
Source§impl StormFront
impl StormFront
pub fn cold_front(ox: f32, oz: f32, direction: f32) -> Self
pub fn warm_front(ox: f32, oz: f32, direction: f32) -> Self
pub fn tick(&mut self, dt: f32)
Sourcepub fn signed_distance(&self, x: f32, z: f32) -> f32
pub fn signed_distance(&self, x: f32, z: f32) -> f32
Signed distance from point (x,z) to the frontal boundary. Negative = ahead of the front, positive = behind.
pub fn is_alive(&self) -> bool
Trait Implementations§
Source§impl Clone for StormFront
impl Clone for StormFront
Source§fn clone(&self) -> StormFront
fn clone(&self) -> StormFront
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 StormFront
impl RefUnwindSafe for StormFront
impl Send for StormFront
impl Sync for StormFront
impl Unpin for StormFront
impl UnsafeUnpin for StormFront
impl UnwindSafe for StormFront
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.