Skip to main content

Module water_surface

Module water_surface 

Expand description

Caller-buffered shoreline attributes, Gerstner spectra, buoyancy, optics, and ripples for open water.

Modules§

buoyancy
Multi-Sphere Archimedes Buoyancy Solver & Hydrological State Machine.
gerstner
Zero-Heap Gerstner Wave Spectrum & Nearshore Attenuation Engine.
optics
Hydrologic Optics, Radiative Transfer & Dielectric BSDF Engine.
ripple
2D Interactive Ripple Buffer & Dynamic Wave Equation Solver.
shoreline
spatial
Cold caller-buffered native BVH construction and allocation-free nearest shoreline queries. Exact segment distances remain the acceptance criterion.

Structs§

Aabb
Axis-aligned bounding box in 3D.
ArchimedesProxy
Multi-sphere proxy hull for volumetric character buoyancy.
BioGeoOpticalConstituents
Ecological and Geomorphic Bio-Geo-Optical constituents (CASE-2 Waters).
BuoyancyResult
Instantaneous buoyancy evaluation result.
BuoyancySphere
Sphere element of an Archimedes buoyancy hull.
BvhNode
BVH node: 40 bytes, repr(C), naturally aligned.
DielectricVolumeIop
Inherent Optical Properties (IOP) of a dielectric medium or fluid volume.
GerstnerWave
Individual Gerstner wave harmonic component.
HydrologicalHysteresisGate
Hysteresis gate to filter high-frequency fluid noise before committing discrete transitions.
InteractiveRippleBuffer
A zero-heap 2D discrete wave heightfield solver.
Point2
2D point in double precision for shoreline segment distance queries.
Point3
3D point in double precision for AABB and BVH queries.
ShoreReceipt
ShoreSpatialScratch
ShoreTopology
SimdGerstnerSpectrum
8-harmonic Gerstner wave spectrum for zero-allocation CPU water queries.

Enums§

AllocationClass
Allocation classification for water surface geometry passes.
BvhError
Errors raised by the BVH builder.
ShoreError
SpatialOrderError
Errors raised by spatial ordering functions.
SubmersionState
Locomotion and submersion mode of an entity.

Constants§

ALLOCATION_CLASS
BVH_NODE_SIZE
Node size in bytes.
GRAVITY_M_S2
Gravity constant in m/s².
MAX_BUOYANCY_SPHERES
Maximum number of buoyancy proxy spheres per character/rigid-body hull.
MAX_BVH_DEPTH
Maximum BVH depth (bounded by 2^21 primitives -> 21 levels).
MAX_GERSTNER_HARMONICS
Maximum number of analytical wave components evaluated simultaneously.
PURE_WATER_ABSORPTION_RGB
Pure H2O molecular absorption coefficients in m⁻¹ at 20°C (Smith & Baker, 1981).
PURE_WATER_RAYLEIGH_RGB
Pure H2O molecular Rayleigh scattering coefficients in m⁻¹.
RIPPLE_GRID_DIM
RIPPLE_TOTAL_CELLS
SPATIAL_BUILD_ALLOCATION_CLASS
The optional spatial builder delegates to the native bounded cold BVH lifecycle; nearest-edge traversal itself stays allocation-free.
WATER_DENSITY_KG_M3
Standard water density in kg/m³ (freshwater = 1000.0, ocean = 1025.0).
WAVELENGTH_BLUE_NM
WAVELENGTH_GREEN_NM
WAVELENGTH_RED_NM
Wavelength standards in nanometers: Red (650 nm), Green (532 nm), Blue (450 nm).

Functions§

build_bvh_recursive
Build a BVH using the deterministic Morton-sorted recursive builder.
point_segment_distance_sq_2d
Squared distance from point p to segment ab in 2D.
sample_combined_water_surface
Combines an analytical Gerstner wave spectrum with a local dynamic interactive ripple buffer.
shore_distance_accelerated_into
Accelerated shore-distance field into out.
shore_distance_into
Allocation-free reference calculation; accelerated loading shares its topology.
shore_topology_into
Distance in mesh X/Z units to the nearest topological boundary edge. edges is reusable scratch, one u64 per triangle index plus input vertex. Sorted undirected edge keys compact boundary edges in place; no heap is allocated. Separate surfaces keep separate boundaries. Streamed tile seams need shared topology before this authoring pass, not a shader guess about their outline.
sort_by_morton_3d
Compute Morton codes for a 3D point set and sort indices by code.
spatial_working_bytes
Includes caller arrays and the native BVH builder’s bounded centroid scratch.