//
// 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
{
///
///
/// C++:
/// Jolt/Physics/Constraints/ConstraintPart/HingeRotationConstraintPart.h:43
///
/// class HingeRotationConstraintPart
///
///
[InteropHandle]
public readonly partial struct HingeRotationConstraintPart : IDisposable
{
public static HingeRotationConstraintPart Create() => Jolt.PInvoke.HingeRotationConstraintPart_Create();
///
///
/// Calculate properties used during the functions below
///
///
/// C++:
/// Jolt/Physics/Constraints/ConstraintPart/HingeRotationConstraintPart.h:76
///
/// inline void CalculateConstraintProperties(const Body &inBody1, Mat44Arg inRotation1, Vec3Arg inWorldSpaceHingeAxis1, const Body &inBody2, Mat44Arg inRotation2, Vec3Arg inWorldSpaceHingeAxis2)
///
///
public void CalculateConstraintProperties(
Body body1,
in float4x4 rotation1,
float3 worldSpaceHingeAxis1,
Body body2,
in float4x4 rotation2,
float3 worldSpaceHingeAxis2
) =>
Jolt.PInvoke.HingeRotationConstraintPart_CalculateConstraintProperties(
this,
body1,
in rotation1,
worldSpaceHingeAxis1,
body2,
in rotation2,
worldSpaceHingeAxis2
);
///
///
/// Deactivate this constraint
///
///
/// C++:
/// Jolt/Physics/Constraints/ConstraintPart/HingeRotationConstraintPart.h:119
///
/// inline void Deactivate()
///
///
public void Deactivate() => Jolt.PInvoke.HingeRotationConstraintPart_Deactivate(this);
///
///
/// Must be called from the WarmStartVelocityConstraint call to apply the previous frame's impulses
///
///
/// C++:
/// Jolt/Physics/Constraints/ConstraintPart/HingeRotationConstraintPart.h:126
///
/// inline void WarmStart(Body &ioBody1, Body &ioBody2, float inWarmStartImpulseRatio)
///
///
public void WarmStart(Body body1, Body body2, float warmStartImpulseRatio) =>
Jolt.PInvoke.HingeRotationConstraintPart_WarmStart(this, body1, body2, warmStartImpulseRatio);
///
///
/// Iteratively update the velocity constraint. Makes sure d/dt C(...) = 0, where C is the constraint
/// equation.
///
///
/// C++:
/// Jolt/Physics/Constraints/ConstraintPart/HingeRotationConstraintPart.h:133
///
/// inline bool SolveVelocityConstraint(Body &ioBody1, Body &ioBody2)
///
///
public bool SolveVelocityConstraint(Body body1, Body body2) =>
Jolt.PInvoke.HingeRotationConstraintPart_SolveVelocityConstraint(this, body1, body2);
///
///
/// Iteratively update the position constraint. Makes sure C(...) = 0.
///
///
/// C++:
/// Jolt/Physics/Constraints/ConstraintPart/HingeRotationConstraintPart.h:151
///
/// inline bool SolvePositionConstraint(Body &ioBody1, Body &ioBody2, float inBaumgarte) const
///
///
public bool SolvePositionConstraint(Body body1, Body body2, float baumgarte) =>
Jolt.PInvoke.HingeRotationConstraintPart_SolvePositionConstraint(this, body1, body2, baumgarte);
public void Dispose() => Jolt.PInvoke.HingeRotationConstraintPart_Destroy(this);
}
}