// Crest Water System // Copyright © 2024 Wave Harmonic. All rights reserved. using UnityEngine; // Linter does not support mixing inheritdoc + defining own parameters. #pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) namespace WaveHarmonic.Crest { /// /// Interface for an object that returns water surface displacement and height. /// public interface IFlowProvider : IQueryProvider { internal static NoneProvider None { get; } = new(); internal static IFlowProvider Create(WaterRenderer water) { return water.MultipleViewpoints ? new FlowQueryPerCamera(water) : new FlowQuery(water); } /// /// Gives a stationary water (no horizontal flow). /// internal sealed class NoneProvider : IFlowProvider { public int Query(int _0, float _1, Vector3[] _2, Vector3[] result, Vector3? _3 = null) { if (result != null) System.Array.Clear(result, 0, result.Length); return 0; } } /// /// Query water flow data (horizontal motion) at a set of points. /// /// Water surface flow velocities at the query positions. /// int Query(int hash, float minimumLength, Vector3[] points, Vector3[] results, Vector3? center = null); } }