Vixen
c7401864
csharp
public sealed class WaterDisturbances

A step's disturbances, for whoever wants them.

Read the guide page for this →

Remarks

A bounded ring rather than a list, and the bound is § D12's own: "an unbounded number of sources is how this feature becomes a frame-time cliff". What does not fit is counted into Overflowed rather than dropped in silence.

⚠ Drained by the consumer and cleared by the producer, not the other way round. There is more than one consumer — the ripple field and the particles — so a queue that emptied itself on the first read would give the second one nothing, and the symptom is a wake with no spray or spray with no wake depending on the order two systems were added in. Clear is the step's own call.

Fields and properties (4)

  • public int Budget

    How many one step may hold.

  • public int Count

    How many this step has.

  • public int Overflowed

    How many it had to refuse.

  • public ReadOnlySpan<WaterDisturbance> Queued

    This step's disturbances.

Methods (3)

  • public WaterDisturbances(int budget = 64)

    Creates a queue with a stated budget.

  • public bool Add(in WaterDisturbance disturbance)

    Adds one, if it fits.

  • public void Clear()

    Empties it, at the end of a step.

Used by (4)

  • BuoyancySystemVixen.Water.Physics
  • WaterDisturbanceTestsVixen.Water.Tests
  • WaterRippleSimulationVixen.Rendering.Water
  • WaterRipplesVixen.Water