Skip to content

1D Wave Simulation

You can easily create 1D wave simulations through the effect API, without having to worry about any mathematics behind it, because Audectra already takes care of that.

The 1D wave simulation implements the following interface.

public interface IWaveSimulation1D
{
    /// <summary>
    /// Speed of the wave simulation. Default value is 1.0.
    /// </summary>
    double Speed { get; set; }

    /// <summary>
    /// Update the wave simulation according to the passed time. 
    /// </summary>
    /// <param name="dt">passed time since last update</param>
    void Update(double dt);

    /// <summary>
    /// Render the wave simulation scene into the passed render object.
    /// </summary>
    /// <param name="render">simulation will be rendered into this object</param>
    void Render(IRender render);

    /// <summary>
    /// Add a droplet to the wave simulation.
    /// </summary>
    /// <param name="x">position of the droplet</param>
    /// <param name="color">color of the droplet</param>
    void AddDrop(double x, SKColor color);

    /// <summary>
    /// Add a droplet to the wave simulation and scale its size.
    /// </summary>
    /// <param name="x">position of the droplet</param>
    /// <param name="color">color of the droplet</param>
    /// <param name="scale">scale for the droplet size</param>
    void AddDrop(double x, SKColor color, double scale);
}