@equinor/videx-3d
    Preparing search index...

    Interface OceanSampler

    Read-only sampler for the live ocean surface. Lets non-rendering code (e.g. floating objects) query the water height at any world X/Z, in sync with the animated wave field shown on screen.

    The height is summed from the same spectral wave components the shader uses (uWaveA/uWaveB + uTime, read by reference from the material), so it always matches the current sea state, wind and animation time. The optional Gerstner horizontal displacement and the render-time footprint LOD fade are intentionally ignored — they are visual-only refinements, not needed for a plausible floating response, and skipping them keeps sampling cheap.

    Coordinates are in the Ocean group's local frame (sea level = local y 0), which equals world space for the typical flat, unrotated planar ocean.

    interface OceanSampler {
        significantHeight: number;
        getHeightAt(x: number, z: number): number;
    }
    Index

    Properties

    Methods

    Properties

    significantHeight: number

    Significant wave height (m) of the current sea state.

    Methods

    • Water surface height (local y) at the given local X/Z.

      Parameters

      • x: number
      • z: number

      Returns number