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