1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Water rendering with animated waves and volumetric effects.
//!
//! Provides realistic water surfaces and volumetric water bodies:
//!
//! - [`Water`]: Component for water surface appearance and animation
//! - [`VolumeShape`]: Box, Cylinder, or Sphere for volumetric water
//! - [`VolumeFlowType`]: Waterfall, Mist, or Cascade flow animation
//!
//! # Surface Water
//!
//! Create an animated water plane:
//!
//! ```ignore
//! let water = spawn_water_plane_at(world, Vec3::new(0.0, 0.0, 0.0));
//! world.core.set_water(water, Water::new()
//! .with_height(0.6) // Wave amplitude
//! .with_choppy(4.0) // Wave sharpness
//! .with_speed(0.8) // Animation speed
//! .with_frequency(0.16) // Wave frequency
//! .with_base_color(0.0, 0.09, 0.18)
//! .with_water_color(0.48, 0.54, 0.36));
//! ```
//!
//! # Volumetric Water (Waterfalls, Pools)
//!
//! Create 3D water volumes with flow effects:
//!
//! ```ignore
//! let waterfall = world.spawn_entities(
//! WATER | RENDER_MESH | LOCAL_TRANSFORM | GLOBAL_TRANSFORM | LOCAL_TRANSFORM_DIRTY,
//! 1
//! )[0];
//!
//! world.core.set_water(waterfall, Water::new()
//! .with_volumetric(true)
//! .with_volume_shape(VolumeShape::Box)
//! .with_volume_size(2.0, 10.0, 1.0) // width, height, depth
//! .with_volume_flow_type(VolumeFlowType::Waterfall)
//! .with_flow(0.0, -1.0, 1.0)); // direction_x, direction_z, strength
//! ```
//!
//! # Vertical Water (Waterfalls)
//!
//! ```ignore
//! let water = Water::new()
//! .with_vertical(true) // Render as vertical plane
//! .with_flow(0.0, 1.0, 2.0); // Downward flow
//! ```
//!
//! # Water Properties
//!
//! | Property | Description |
//! |----------|-------------|
//! | `wave_height` | Wave amplitude in world units |
//! | `choppy` | Wave sharpness (higher = sharper peaks) |
//! | `speed` | Animation speed multiplier |
//! | `frequency` | Wave frequency (lower = longer waves) |
//! | `fresnel_power` | Reflection vs refraction balance |
//! | `specular_strength` | Sun reflection intensity |
//! | `edge_feather_distance` | Soft edges at shore |
//!
//! [`Water`]: components::Water
//! [`VolumeShape`]: components::VolumeShape
//! [`VolumeFlowType`]: components::VolumeFlowType
pub mod components;
pub mod wave;
pub use components::*;
pub use wave::*;