pub struct WaterWave {
pub amplitude: f32,
pub wavelength: f32,
pub speed: f32,
pub direction: [f32; 2],
pub steepness: f32,
}Expand description
One wave in a water surface’s motion. A surface sums up to four of these
to displace its flat grid. Each wave travels
horizontally along direction, rising and falling with amplitude peak
height, wavelength distance between crests, and speed metres per second.
steepness in [0, 1] pinches the crests and broadens the troughs (choppier
water).
Fields§
§amplitude: f32Peak height of the wave, in world units.
wavelength: f32Distance between successive crests, in world units.
speed: f32Horizontal travel speed, in metres per second.
direction: [f32; 2]Horizontal travel direction [x, z].
steepness: f32Crest sharpness in [0, 1]. 0 is a smooth sine; higher pinches crests and broadens troughs.
Trait Implementations§
impl Copy for WaterWave
Source§impl<'de> Deserialize<'de> for WaterWave
impl<'de> Deserialize<'de> for WaterWave
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WaterWave, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WaterWave, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for WaterWave
impl Serialize for WaterWave
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for WaterWave
impl RefUnwindSafe for WaterWave
impl Send for WaterWave
impl Sync for WaterWave
impl Unpin for WaterWave
impl UnsafeUnpin for WaterWave
impl UnwindSafe for WaterWave
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