//
// 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 path that follows a Hermite spline
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraintPathHermite.h:12
///
/// class PathConstraintPathHermite final : public PathConstraintPath
///
///
[InteropHandle]
public readonly partial struct PathConstraintPathHermite : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraintPathHermite.h:32
///
/// struct Point
///
///
[StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct Point
{
///
///
/// Position on the path
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraintPathHermite.h:36
///
/// Vec3 mPosition
///
///
[FieldOffset(0)]
public float3 Position;
///
///
/// Tangent of the path, does not need to be normalized (in the direction of the path)
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraintPathHermite.h:37
///
/// Vec3 mTangent
///
///
[FieldOffset(16)]
public float3 Tangent;
///
///
/// Normal of the path (together with the tangent along the curve this forms a basis for the constraint)
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraintPathHermite.h:38
///
/// Vec3 mNormal
///
///
[FieldOffset(32)]
public float3 Normal;
}
public static PathConstraintPathHermite Create() => Jolt.PInvoke.PathConstraintPathHermite_Create();
///
public RTTI GetRTTI() => ((PathConstraintPath)this).GetRTTI();
///
public unsafe Ptr CastTo(RTTI rtti) => ((PathConstraintPath)this).CastTo(rtti);
///
public float GetPathMaxFraction() => ((PathConstraintPath)this).GetPathMaxFraction();
///
public float GetClosestPoint(float3 position, float fractionHint) =>
((PathConstraintPath)this).GetClosestPoint(position, fractionHint);
///
public void GetPointOnPath(
float fraction,
out float3 pathPosition,
out float3 pathTangent,
out float3 pathNormal,
out float3 pathBinormal
) =>
((PathConstraintPath)this).GetPointOnPath(
fraction,
out pathPosition,
out pathTangent,
out pathNormal,
out pathBinormal
);
///
///
/// Adds a point to the path
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraintPathHermite.h:27
///
/// void AddPoint(Vec3Arg inPosition, Vec3Arg inTangent, Vec3Arg inNormal)
///
///
public void AddPoint(float3 position, float3 tangent, float3 normal) =>
Jolt.PInvoke.PathConstraintPathHermite_AddPoint(this, position, tangent, normal);
///
public void SaveBinaryState(StreamOut stream) => ((PathConstraintPath)this).SaveBinaryState(stream);
public void AddRef() => ((PathConstraintPath)this).AddRef();
public void Release() => ((PathConstraintPath)this).Release();
public uint GetRefCount() => ((PathConstraintPath)this).GetRefCount();
public static implicit operator PathConstraintPath(PathConstraintPathHermite value) =>
Unsafe.BitCast(value);
public void Dispose()
{
if (IsNull())
return;
Release();
}
///
public void SetIsLooping(bool isLooping) => ((PathConstraintPath)this).SetIsLooping(isLooping);
///
public bool IsLooping() => ((PathConstraintPath)this).IsLooping();
///
public void DrawPath(DebugRenderer renderer, in float4x4 baseTransform) =>
((PathConstraintPath)this).DrawPath(renderer, in baseTransform);
}
}