pub struct Puddle {
pub centre: [f32; 2],
pub radius: f32,
pub volume: f32,
pub area: f32,
pub evap_rate: f32,
pub age: f32,
pub frozen: bool,
}Expand description
A surface puddle — formed when water accumulates above a threshold.
Fields§
§centre: [f32; 2]§radius: f32§volume: f32Water volume (m³).
area: f32Surface area (m²).
evap_rate: f32Evaporation rate (m³/s) under current conditions.
age: f32Age (seconds).
frozen: boolIs frozen?
Implementations§
Source§impl Puddle
impl Puddle
pub fn new(cx: f32, cz: f32, initial_volume: f32) -> Self
pub fn tick(&mut self, dt: f32, temp_c: f32, wind_speed: f32)
pub fn add_water(&mut self, volume: f32)
pub fn is_alive(&self) -> bool
pub fn contains(&self, x: f32, z: f32) -> bool
Sourcepub fn centre_depth_m(&self) -> f32
pub fn centre_depth_m(&self) -> f32
Return water depth at the centre of the puddle.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Puddle
impl RefUnwindSafe for Puddle
impl Send for Puddle
impl Sync for Puddle
impl Unpin for Puddle
impl UnsafeUnpin for Puddle
impl UnwindSafe for Puddle
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.