pub struct Water<M: Material> { /* private fields */ }Expand description
A water geometry with an applied material.
Implementations§
Source§impl<M: Material> Water<M>
impl<M: Material> Water<M>
Sourcepub fn new(
context: &Context,
material: M,
height: f32,
center: Vec2,
side_length: f32,
vertex_distance: f32,
parameters: impl IntoIterator<Item = WaveParameters> + Clone,
) -> Self
pub fn new( context: &Context, material: M, height: f32, center: Vec2, side_length: f32, vertex_distance: f32, parameters: impl IntoIterator<Item = WaveParameters> + Clone, ) -> Self
Constructs a new Water object with the given material and at the given height.
The center is the center of the visualized water surface, which can be updated using Self::set_center to simualte an infinite water surface.
The side_length is the length of one side of the visualized water surface.
The vertex_distance is the distance between vertices.
Sourcepub fn set_center(&mut self, center: Vec2)
pub fn set_center(&mut self, center: Vec2)
Set the center of the water. To be able to move the water with the camera, thereby simulating infinite water.
Sourcepub fn set_height(&mut self, height: f32)
pub fn set_height(&mut self, height: f32)
Set the average height of the water.
Sourcepub fn set_parameters(
&mut self,
parameters: impl IntoIterator<Item = WaveParameters> + Clone,
)
pub fn set_parameters( &mut self, parameters: impl IntoIterator<Item = WaveParameters> + Clone, )
Set the currently used WaveParameters.
Trait Implementations§
Source§impl<'a, M: Material> IntoIterator for &'a Water<M>
impl<'a, M: Material> IntoIterator for &'a Water<M>
Auto Trait Implementations§
impl<M> Freeze for Water<M>where
M: Freeze,
impl<M> RefUnwindSafe for Water<M>where
M: RefUnwindSafe,
impl<M> Send for Water<M>where
M: Send,
impl<M> Sync for Water<M>where
M: Sync,
impl<M> Unpin for Water<M>where
M: Unpin,
impl<M> UnwindSafe for Water<M>where
M: UnwindSafe,
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