//
// 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
{
///
///
/// Ellipse centered around the origin
///
///
/// C++:
/// Jolt/Geometry/Ellipse.h:13
///
/// class Ellipse
///
///
///
///
/// Ellipse centered around the origin
/// @see https://en.wikipedia.org/wiki/Ellipse
///
///
[InteropHandle]
public readonly partial struct Ellipse : IDisposable
{
///
///
/// Construct ellipse with radius A along the X-axis and B along the Y-axis
///
///
/// C++:
/// Jolt/Geometry/Ellipse.h:19
///
/// Ellipse(float inA, float inB)
///
///
public static Ellipse Create(float a, float b) => Jolt.PInvoke.Ellipse_Create(a, b);
///
///
/// Check if inPoint is inside the ellipse
///
///
/// C++:
/// Jolt/Geometry/Ellipse.h:22
///
/// bool IsInside(const Float2 &inPoint) const
///
///
public bool IsInside(float2 point) => Jolt.PInvoke.Ellipse_IsInside(this, point);
///
///
/// Get the closest point on the ellipse to inPoint Assumes inPoint is outside the ellipse
///
///
/// C++:
/// Jolt/Geometry/Ellipse.h:30
///
/// Float2 GetClosestPoint(const Float2 &inPoint) const
///
///
///
///
/// Get the closest point on the ellipse to inPoint
/// Assumes inPoint is outside the ellipse
/// @see Rotation Joint Limits in Quaternion Space by Gino van den Bergen, section 10.1 in Game Engine Gems 3.
///
///
public float2 GetClosestPoint(float2 point)
{
Jolt.PInvoke.Ellipse_GetClosestPoint(this, point, out var _outResult);
return _outResult;
}
///
///
/// Get normal at point inPoint (non-normalized vector)
///
///
/// C++:
/// Jolt/Geometry/Ellipse.h:66
///
/// Float2 GetNormal(const Float2 &inPoint) const
///
///
public float2 GetNormal(float2 point)
{
Jolt.PInvoke.Ellipse_GetNormal(this, point, out var _outResult);
return _outResult;
}
public void Dispose() => Jolt.PInvoke.Ellipse_Destroy(this);
}
}