//
// 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
{
///
///
/// Base class for all constraints that involve 2 bodies. Body1 is usually considered the parent, Body2 the
/// child.
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:26
///
/// class TwoBodyConstraint : public Constraint
///
///
[InteropHandle]
public readonly partial struct TwoBodyConstraint : IDisposable
{
///
public ConstraintType GetConstraintType() => ((Constraint)this).GetConstraintType();
///
public bool IsActive() => ((Constraint)this).IsActive();
///
public void DrawConstraintReferenceFrame(DebugRenderer renderer) =>
((Constraint)this).DrawConstraintReferenceFrame(renderer);
///
///
/// Access to the connected bodies
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:44
///
/// Body * GetBody1() const
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public Body GetBody1() => Jolt.PInvoke.TwoBodyConstraint_GetBody1(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:45
///
/// Body * GetBody2() const
///
///
///
///
/// The returned handle is borrowed from its owner; don't Dispose it.
///
///
public Body GetBody2() => Jolt.PInvoke.TwoBodyConstraint_GetBody2(this);
///
///
/// Calculates the transform that transforms from constraint space to body 1 space. The first column of the
/// matrix is the primary constraint axis (e.g. the hinge axis / slider direction), second column the
/// secondary etc.
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:48
///
/// virtual Mat44 GetConstraintToBody1Matrix() const = 0
///
///
public float4x4 GetConstraintToBody1Matrix() => Jolt.PInvoke.TwoBodyConstraint_GetConstraintToBody1Matrix(this);
///
///
/// Calculates the transform that transforms from constraint space to body 2 space. The first column of the
/// matrix is the primary constraint axis (e.g. the hinge axis / slider direction), second column the
/// secondary etc.
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:51
///
/// virtual Mat44 GetConstraintToBody2Matrix() const = 0
///
///
public float4x4 GetConstraintToBody2Matrix() => Jolt.PInvoke.TwoBodyConstraint_GetConstraintToBody2Matrix(this);
///
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 AddRef() => ((Constraint)this).AddRef();
public void Release() => ((Constraint)this).Release();
public uint GetRefCount() => ((Constraint)this).GetRefCount();
public static implicit operator Constraint(TwoBodyConstraint value) =>
Unsafe.BitCast(value);
public void Dispose()
{
if (IsNull())
return;
Release();
}
///
public ConstraintSubType GetSubType() => ((Constraint)this).GetSubType();
///
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 NotifyShapeChanged(uint bodyID, float3 deltaCOM) =>
((Constraint)this).NotifyShapeChanged(bodyID, deltaCOM);
///
public void ResetWarmStart() => ((Constraint)this).ResetWarmStart();
///
public void SetupVelocityConstraint(float deltaTime) => ((Constraint)this).SetupVelocityConstraint(deltaTime);
///
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 void DrawConstraintLimits(DebugRenderer renderer) => ((Constraint)this).DrawConstraintLimits(renderer);
///
public float GetDrawConstraintSize() => ((Constraint)this).GetDrawConstraintSize();
///
public void SetDrawConstraintSize(float size) => ((Constraint)this).SetDrawConstraintSize(size);
///
public ConstraintSettings GetConstraintSettings() => ((Constraint)this).GetConstraintSettings();
}
}