//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// A set of points (x, y) that form a linear curve
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:16
///
/// class LinearCurve
///
///
[InteropHandle]
public readonly partial struct LinearCurve : IDisposable
{
public static LinearCurve Create() => Jolt.PInvoke.LinearCurve_Create();
///
///
/// Remove all points
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:32
///
/// void Clear()
///
///
public void Clear() => Jolt.PInvoke.LinearCurve_Clear(this);
///
///
/// Reserve memory for inNumPoints points
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:35
///
/// void Reserve(uint inNumPoints)
///
///
public void Reserve(uint numPoints) => Jolt.PInvoke.LinearCurve_Reserve(this, numPoints);
///
///
/// Add a point to the curve. Points must be inserted in ascending X or Sort() needs to be called when all
/// points have been added.
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:40
///
/// void AddPoint(float inX, float inY)
///
///
///
///
/// Add a point to the curve. Points must be inserted in ascending X or Sort() needs to be called when all points have been added.
/// @param inX X value
/// @param inY Y value
///
///
public void AddPoint(float x, float y) => Jolt.PInvoke.LinearCurve_AddPoint(this, x, y);
///
///
/// Sort the points on X ascending
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:43
///
/// void Sort()
///
///
public void Sort() => Jolt.PInvoke.LinearCurve_Sort(this);
///
///
/// Get the lowest X value
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:46
///
/// float GetMinX() const
///
///
public float GetMinX() => Jolt.PInvoke.LinearCurve_GetMinX(this);
///
///
/// Get the highest X value
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:49
///
/// float GetMaxX() const
///
///
public float GetMaxX() => Jolt.PInvoke.LinearCurve_GetMaxX(this);
///
///
/// Sample value on the curve
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:54
///
/// float GetValue(float inX) const
///
///
///
///
/// Sample value on the curve
/// @param inX X value to sample at
/// @return Interpolated Y value
///
///
public float GetValue(float x) => Jolt.PInvoke.LinearCurve_GetValue(this, x);
///
///
/// Saves the state of this object in binary form to inStream.
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:57
///
/// void SaveBinaryState(StreamOut &inStream) const
///
///
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.LinearCurve_SaveBinaryState(this, stream);
///
///
/// Restore the state of this object from inStream.
///
///
/// C++:
/// Jolt/Core/LinearCurve.h:60
///
/// void RestoreBinaryState(StreamIn &inStream)
///
///
public void RestoreBinaryState(StreamIn stream) => Jolt.PInvoke.LinearCurve_RestoreBinaryState(this, stream);
public void Dispose() => Jolt.PInvoke.LinearCurve_Destroy(this);
}
}