mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
100 lines
3.7 KiB
C#
100 lines
3.7 KiB
C#
// <auto-generated/>
|
|
// 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
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Ellipse centered around the origin
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Ellipse.h#L13">Jolt/Geometry/Ellipse.h:13</see>
|
|
/// <br/>
|
|
/// <c>class Ellipse</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Ellipse centered around the origin
|
|
/// @see https://en.wikipedia.org/wiki/Ellipse
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct Ellipse : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Construct ellipse with radius A along the X-axis and B along the Y-axis
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Ellipse.h#L19">Jolt/Geometry/Ellipse.h:19</see>
|
|
/// <br/>
|
|
/// <c>Ellipse(float inA, float inB)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Ellipse Create(float a, float b) => Jolt.PInvoke.Ellipse_Create(a, b);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Check if inPoint is inside the ellipse
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Ellipse.h#L22">Jolt/Geometry/Ellipse.h:22</see>
|
|
/// <br/>
|
|
/// <c>bool IsInside(const Float2 &inPoint) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool IsInside(float2 point) => Jolt.PInvoke.Ellipse_IsInside(this, point);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the closest point on the ellipse to inPoint Assumes inPoint is outside the ellipse
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Ellipse.h#L30">Jolt/Geometry/Ellipse.h:30</see>
|
|
/// <br/>
|
|
/// <c>Float2 GetClosestPoint(const Float2 &inPoint) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// 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.
|
|
/// </code>
|
|
/// </remarks>
|
|
public float2 GetClosestPoint(float2 point)
|
|
{
|
|
Jolt.PInvoke.Ellipse_GetClosestPoint(this, point, out var _outResult);
|
|
return _outResult;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get normal at point inPoint (non-normalized vector)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Geometry/Ellipse.h#L66">Jolt/Geometry/Ellipse.h:66</see>
|
|
/// <br/>
|
|
/// <c>Float2 GetNormal(const Float2 &inPoint) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float2 GetNormal(float2 point)
|
|
{
|
|
Jolt.PInvoke.Ellipse_GetNormal(this, point, out var _outResult);
|
|
return _outResult;
|
|
}
|
|
|
|
public void Dispose() => Jolt.PInvoke.Ellipse_Destroy(this);
|
|
}
|
|
}
|