//
// 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
{
///
///
/// Path constraint, used to constrain the degrees of freedom between two bodies to a path
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:79
///
/// class PathConstraint final : public TwoBodyConstraint
///
///
[InteropHandle]
public readonly partial struct PathConstraint : IDisposable
{
///
///
/// Construct point constraint
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:85
///
/// PathConstraint(Body &inBody1, Body &inBody2, const PathConstraintSettings &inSettings)
///
///
public static PathConstraint Create(Body body1, Body body2, PathConstraintSettings settings) =>
Jolt.PInvoke.PathConstraint_Create(body1, body2, settings);
///
public ConstraintSubType GetSubType() => ((Constraint)this).GetSubType();
///
public void NotifyShapeChanged(uint bodyID, float3 deltaCOM) =>
((Constraint)this).NotifyShapeChanged(bodyID, deltaCOM);
///
public void SetupVelocityConstraint(float deltaTime) => ((Constraint)this).SetupVelocityConstraint(deltaTime);
///
public void ResetWarmStart() => ((Constraint)this).ResetWarmStart();
///
public void WarmStartVelocityConstraint(float warmStartImpulseRatio) =>
((Constraint)this).WarmStartVelocityConstraint(warmStartImpulseRatio);
///
public bool SolveVelocityConstraint(float deltaTime) => ((Constraint)this).SolveVelocityConstraint(deltaTime);
///
public bool SolvePositionConstraint(float deltaTime, float baumgarte) =>
((Constraint)this).SolvePositionConstraint(deltaTime, baumgarte);
///
public void DrawConstraint(DebugRenderer renderer) => ((Constraint)this).DrawConstraint(renderer);
///
public bool IsActive() => ((Constraint)this).IsActive();
///
public ConstraintSettings GetConstraintSettings() => ((Constraint)this).GetConstraintSettings();
///
public float4x4 GetConstraintToBody1Matrix() => ((TwoBodyConstraint)this).GetConstraintToBody1Matrix();
///
public float4x4 GetConstraintToBody2Matrix() => ((TwoBodyConstraint)this).GetConstraintToBody2Matrix();
///
///
/// Update the path for this constraint
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:108
///
/// void SetPath(const PathConstraintPath *inPath, float inPathFraction)
///
///
public void SetPath(PathConstraintPath path, float pathFraction) =>
Jolt.PInvoke.PathConstraint_SetPath(this, path, pathFraction);
///
///
/// Access to the current path
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:111
///
/// const PathConstraintPath * GetPath() const
///
///
///
///
/// The returned handle carries its own reference; Dispose it once when you're done.
///
///
public PathConstraintPath GetPath() => Jolt.PInvoke.PathConstraint_GetPath(this);
///
///
/// Access to the current fraction along the path e [0, GetPath()->GetMaxPathFraction()]
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:114
///
/// float GetPathFraction() const
///
///
public float GetPathFraction() => Jolt.PInvoke.PathConstraint_GetPathFraction(this);
///
///
/// Friction control
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:117
///
/// void SetMaxFrictionForce(float inFrictionForce)
///
///
public void SetMaxFrictionForce(float frictionForce) =>
Jolt.PInvoke.PathConstraint_SetMaxFrictionForce(this, frictionForce);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:118
///
/// float GetMaxFrictionForce() const
///
///
public float GetMaxFrictionForce() => Jolt.PInvoke.PathConstraint_GetMaxFrictionForce(this);
///
///
/// Position motor settings
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:121
///
/// MotorSettings & GetPositionMotorSettings()
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public MotorSettings GetPositionMotorSettings() => Jolt.PInvoke.PathConstraint_GetPositionMotorSettings(this);
///
///
/// Position motor controls (drives body 2 along the path)
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:125
///
/// void SetPositionMotorState(EMotorState inState)
///
///
public void SetPositionMotorState(MotorState state) =>
Jolt.PInvoke.PathConstraint_SetPositionMotorState(this, state);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:126
///
/// EMotorState GetPositionMotorState() const
///
///
public MotorState GetPositionMotorState() => Jolt.PInvoke.PathConstraint_GetPositionMotorState(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:127
///
/// void SetTargetVelocity(float inVelocity)
///
///
public void SetTargetVelocity(float velocity) => Jolt.PInvoke.PathConstraint_SetTargetVelocity(this, velocity);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:128
///
/// float GetTargetVelocity() const
///
///
public float GetTargetVelocity() => Jolt.PInvoke.PathConstraint_GetTargetVelocity(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:129
///
/// void SetTargetPathFraction(float inFraction)
///
///
public void SetTargetPathFraction(float fraction) =>
Jolt.PInvoke.PathConstraint_SetTargetPathFraction(this, fraction);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:130
///
/// float GetTargetPathFraction() const
///
///
public float GetTargetPathFraction() => Jolt.PInvoke.PathConstraint_GetTargetPathFraction(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:133
///
/// inline Vector<2> GetTotalLambdaPosition() const
///
///
///
///
/// @name Get Lagrange multiplier from last physics update (the linear/angular impulse applied to satisfy
/// the constraint)
///
///
public float2 GetTotalLambdaPosition() => Jolt.PInvoke.PathConstraint_GetTotalLambdaPosition(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:134
///
/// inline float GetTotalLambdaPositionLimits() const
///
///
public float GetTotalLambdaPositionLimits() => Jolt.PInvoke.PathConstraint_GetTotalLambdaPositionLimits(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:135
///
/// inline float GetTotalLambdaMotor() const
///
///
public float GetTotalLambdaMotor() => Jolt.PInvoke.PathConstraint_GetTotalLambdaMotor(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:136
///
/// inline Vector<2> GetTotalLambdaRotationHinge() const
///
///
public float2 GetTotalLambdaRotationHinge() => Jolt.PInvoke.PathConstraint_GetTotalLambdaRotationHinge(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/PathConstraint.h:137
///
/// inline Vec3 GetTotalLambdaRotation() const
///
///
public float3 GetTotalLambdaRotation() => Jolt.PInvoke.PathConstraint_GetTotalLambdaRotation(this);
public void AddRef() => ((Constraint)this).AddRef();
public void Release() => ((Constraint)this).Release();
public uint GetRefCount() => ((Constraint)this).GetRefCount();
public static implicit operator TwoBodyConstraint(PathConstraint value) =>
Unsafe.BitCast(value);
public static implicit operator Constraint(PathConstraint value) =>
Unsafe.BitCast(value);
public void Dispose()
{
if (IsNull())
return;
Release();
}
///
public Body GetBody1() => ((TwoBodyConstraint)this).GetBody1();
///
public Body GetBody2() => ((TwoBodyConstraint)this).GetBody2();
///
public ConstraintType GetConstraintType() => ((Constraint)this).GetConstraintType();
///
public uint GetConstraintPriority() => ((Constraint)this).GetConstraintPriority();
///
public void SetConstraintPriority(uint priority) => ((Constraint)this).SetConstraintPriority(priority);
///
public void SetNumVelocityStepsOverride(uint n) => ((Constraint)this).SetNumVelocityStepsOverride(n);
///
public uint GetNumVelocityStepsOverride() => ((Constraint)this).GetNumVelocityStepsOverride();
///
public void SetNumPositionStepsOverride(uint n) => ((Constraint)this).SetNumPositionStepsOverride(n);
///
public uint GetNumPositionStepsOverride() => ((Constraint)this).GetNumPositionStepsOverride();
///
public void SetEnabled(bool enabled) => ((Constraint)this).SetEnabled(enabled);
///
public bool GetEnabled() => ((Constraint)this).GetEnabled();
///
public ulong GetUserData() => ((Constraint)this).GetUserData();
///
public void SetUserData(ulong userData) => ((Constraint)this).SetUserData(userData);
///
public void BuildIslands(uint constraintIndex, IslandBuilder builder, BodyManager bodyManager) =>
((Constraint)this).BuildIslands(constraintIndex, builder, bodyManager);
///
public uint BuildIslandSplits(LargeIslandSplitter splitter) => ((Constraint)this).BuildIslandSplits(splitter);
///
public void DrawConstraintLimits(DebugRenderer renderer) => ((Constraint)this).DrawConstraintLimits(renderer);
///
public void DrawConstraintReferenceFrame(DebugRenderer renderer) =>
((Constraint)this).DrawConstraintReferenceFrame(renderer);
///
public float GetDrawConstraintSize() => ((Constraint)this).GetDrawConstraintSize();
///
public void SetDrawConstraintSize(float size) => ((Constraint)this).SetDrawConstraintSize(size);
}
}