//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:41
///
/// class PathConstraintSettings final : public TwoBodyConstraintSettings
///
///
///
///
/// Path constraint settings, used to constrain the degrees of freedom between two bodies to a path
///
/// The requirements of the path are that:
/// * Tangent, normal and bi-normal form an orthonormal basis with: tangent cross bi-normal = normal
/// * The path points along the tangent vector
/// * The path is continuous so doesn't contain any sharp corners
///
/// The reason for all this is that the constraint acts like a slider constraint with the sliding axis being the tangent vector (the assumption here is that delta time will be small enough so that the path is linear for that delta time).
///
///
[InteropHandle]
public readonly partial struct PathConstraintSettings : IDisposable
{
public static PathConstraintSettings Create() => Jolt.PInvoke.PathConstraintSettings_Create();
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:43
///
///
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public RTTI GetRTTI() => Jolt.PInvoke.PathConstraintSettings_GetRTTI(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:43
///
///
///
///
public unsafe Ptr CastTo(RTTI rTTI) => Jolt.PInvoke.PathConstraintSettings_CastTo(this, rTTI);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:47
///
/// virtual void SaveBinaryState(StreamOut &inStream) const override
///
///
///
///
/// See: ConstraintSettings::SaveBinaryState
///
///
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.PathConstraintSettings_SaveBinaryState(this, stream);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:50
///
/// virtual TwoBodyConstraint * Create(Body &inBody1, Body &inBody2) const override
///
///
///
///
/// Create an instance of this constraint
///
///
public TwoBodyConstraint Create(Body body1, Body body2) => Jolt.PInvoke.PathConstraintSettings_Create_2(this, body1, body2);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:53
///
/// RefConst<PathConstraintPath> mPath
///
///
///
///
/// The path that constrains the two bodies
///
///
public PathConstraintPath GetPath() => Jolt.PInvoke.PathConstraintSettings_GetPath(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:53
///
/// RefConst<PathConstraintPath> mPath
///
///
///
///
/// The path that constrains the two bodies
///
///
public void SetPath(PathConstraintPath value) => Jolt.PInvoke.PathConstraintSettings_SetPath(this, value);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:56
///
/// Vec3 mPathPosition = Vec3::sZero()
///
///
///
///
/// The position of the path start relative to world transform of body 1
///
///
public float3 GetPathPosition() => Jolt.PInvoke.PathConstraintSettings_GetPathPosition(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:56
///
/// Vec3 mPathPosition = Vec3::sZero()
///
///
///
///
/// The position of the path start relative to world transform of body 1
///
///
public void SetPathPosition(float3 value) => Jolt.PInvoke.PathConstraintSettings_SetPathPosition(this, value);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:59
///
/// Quat mPathRotation = Quat::sIdentity()
///
///
///
///
/// The rotation of the path start relative to world transform of body 1
///
///
public floatQuat GetPathRotation() => Jolt.PInvoke.PathConstraintSettings_GetPathRotation(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:59
///
/// Quat mPathRotation = Quat::sIdentity()
///
///
///
///
/// The rotation of the path start relative to world transform of body 1
///
///
public void SetPathRotation(floatQuat value) => Jolt.PInvoke.PathConstraintSettings_SetPathRotation(this, value);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:62
///
/// float mPathFraction = 0.0f
///
///
///
///
/// The fraction along the path that corresponds to the initial position of body 2. Usually this is 0, the
/// beginning of the path. But if you want to start an object halfway the path you can calculate this with
/// mPath->GetClosestPoint(point on path to attach body to).
///
///
public float GetPathFraction() => Jolt.PInvoke.PathConstraintSettings_GetPathFraction(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:62
///
/// float mPathFraction = 0.0f
///
///
///
///
/// The fraction along the path that corresponds to the initial position of body 2. Usually this is 0, the
/// beginning of the path. But if you want to start an object halfway the path you can calculate this with
/// mPath->GetClosestPoint(point on path to attach body to).
///
///
public void SetPathFraction(float value) => Jolt.PInvoke.PathConstraintSettings_SetPathFraction(this, value);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:65
///
/// float mMaxFrictionForce = 0.0f
///
///
///
///
/// Maximum amount of friction force to apply (N) when not driven by a motor.
///
///
public float GetMaxFrictionForce() => Jolt.PInvoke.PathConstraintSettings_GetMaxFrictionForce(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:65
///
/// float mMaxFrictionForce = 0.0f
///
///
///
///
/// Maximum amount of friction force to apply (N) when not driven by a motor.
///
///
public void SetMaxFrictionForce(float value) => Jolt.PInvoke.PathConstraintSettings_SetMaxFrictionForce(this, value);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:71
///
/// EPathRotationConstraintType mRotationConstraintType = EPathRotationConstraintType::Free
///
///
///
///
/// How to constrain the rotation of the body to the path
///
///
public EPathRotationConstraintType GetRotationConstraintType() => Jolt.PInvoke.PathConstraintSettings_GetRotationConstraintType(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:71
///
/// EPathRotationConstraintType mRotationConstraintType = EPathRotationConstraintType::Free
///
///
///
///
/// How to constrain the rotation of the body to the path
///
///
public void SetRotationConstraintType(EPathRotationConstraintType value) => Jolt.PInvoke.PathConstraintSettings_SetRotationConstraintType(this, value);
public void AddRef() => Jolt.PInvoke.PathConstraintSettings_AddRef(this);
public void Release() => Jolt.PInvoke.PathConstraintSettings_Release(this);
public uint GetRefCount() => Jolt.PInvoke.PathConstraintSettings_GetRefCount(this);
public static implicit operator TwoBodyConstraintSettings(PathConstraintSettings value) => Jolt.PInvoke.PathConstraintSettings_AsTwoBodyConstraintSettings(value);
public static implicit operator ConstraintSettings(PathConstraintSettings value) => Jolt.PInvoke.PathConstraintSettings_AsConstraintSettings(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}