threejs-worldgen
    Preparing search index...

    Function sampleWaves

    • Surface height and normal at a fixed (x, z), at time time (seconds). Gerstner waves move water sideways, so the point that ends up above (x, z) is found by a few fixed-point iterations. phase adds a per-wave phase (radians), as the ocean does to keep phases precise far from the origin.

      Parameters

      • waves: readonly Wave[]
      • x: number
      • z: number
      • time: number
      • out: WaveSample = ...
      • Optionalphase: ArrayLike<number>

      Returns WaveSample