还原水插件

This commit is contained in:
2026-03-05 00:14:42 +08:00
parent 0de35591e7
commit e82f2ea6b7
270 changed files with 2773 additions and 12445 deletions

View File

@@ -15,17 +15,12 @@ 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, Vector3? _3 = null)
public int Query(int _0, float _1, Vector3[] _2, Vector3[] result)
{
if (result != null) System.Array.Clear(result, 0, result.Length);
return 0;
@@ -36,7 +31,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, Vector3?)" />
int Query(int hash, float minimumLength, Vector3[] points, Vector3[] results, Vector3? center = null);
/// <inheritdoc cref="IQueryProvider.Query(int, float, Vector3[], int)" />
int Query(int hash, float minimumLength, Vector3[] points, Vector3[] results);
}
}

View File

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