pub struct WindField {
pub grid_w: usize,
pub grid_h: usize,
pub grid_d: usize,
pub resolution: f32,
pub layer_height: f32,
pub data: Vec<WindVector>,
}Expand description
3-D wind field stored as a grid of WindVector.
Fields§
§grid_w: usize§grid_h: usize§grid_d: usize§resolution: f32§layer_height: f32§data: Vec<WindVector>Implementations§
Source§impl WindField
impl WindField
pub fn new( w: usize, h: usize, d: usize, resolution: f32, layer_height: f32, ) -> Self
pub fn set(&mut self, x: usize, y: usize, z: usize, wv: WindVector)
Sourcepub fn sample_world(&self, wx: f32, wy: f32, wz: f32) -> WindVector
pub fn sample_world(&self, wx: f32, wy: f32, wz: f32) -> WindVector
Sample wind at world-space position using trilinear interpolation.
Sourcepub fn fill_from_layers(&mut self, layers: &[AtmosphericLayer])
pub fn fill_from_layers(&mut self, layers: &[AtmosphericLayer])
Fill the entire field with a base directional wind that varies by layer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindField
impl RefUnwindSafe for WindField
impl Send for WindField
impl Sync for WindField
impl Unpin for WindField
impl UnsafeUnpin for WindField
impl UnwindSafe for WindField
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.