升级水插件

This commit is contained in:
2026-01-31 00:32:49 +08:00
parent a739d2fe3b
commit 4123e83573
293 changed files with 13449 additions and 2853 deletions

View File

@@ -15,12 +15,17 @@ namespace WaveHarmonic.Crest
{
internal static NoneProvider None { get; } = new();
internal static IFlowProvider Create(WaterRenderer water)
{
return water.MultipleViewpoints ? new FlowQueryPerCamera(water) : new FlowQuery(water);
}
/// <summary>
/// Gives a stationary water (no horizontal flow).
/// </summary>
internal sealed class NoneProvider : IFlowProvider
{
public int Query(int _0, float _1, Vector3[] _2, Vector3[] result)
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;
@@ -31,7 +36,7 @@ namespace WaveHarmonic.Crest
/// Query water flow data (horizontal motion) at a set of points.
/// </summary>
/// <param name="results">Water surface flow velocities at the query positions.</param>
/// <inheritdoc cref="IQueryProvider.Query(int, float, Vector3[], int)" />
int Query(int hash, float minimumLength, Vector3[] points, Vector3[] results);
/// <inheritdoc cref="IQueryProvider.Query(int, float, Vector3[], int, Vector3?)" />
int Query(int hash, float minimumLength, Vector3[] points, Vector3[] results, Vector3? center = null);
}
}

View File

@@ -6,9 +6,15 @@ namespace WaveHarmonic.Crest
/// <summary>
/// Samples horizontal motion of water volume
/// </summary>
sealed class FlowQuery : QueryBase, IFlowProvider
sealed class FlowQuery : QueryBaseSimple, IFlowProvider
{
public FlowQuery(WaterRenderer water) : base(water) { }
public FlowQuery() : base(WaterRenderer.Instance.FlowLod) { }
public FlowQuery(WaterRenderer water) : base(water.FlowLod) { }
protected override int Kernel => 1;
}
sealed class FlowQueryPerCamera : QueryPerCameraSimple<FlowQuery>, IFlowProvider
{
public FlowQueryPerCamera(WaterRenderer water) : base(water) { }
}
}