//
// 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/TwoBodyConstraint.h:26
///
/// class TwoBodyConstraint : public Constraint
///
///
///
///
/// Base class for all constraints that involve 2 bodies. Body1 is usually considered the parent, Body2 the
/// child.
///
///
[InteropHandle]
public readonly partial struct TwoBodyConstraint : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:35
///
/// virtual EConstraintType GetType() const override
///
///
///
///
/// Get the type of a constraint
///
///
public EConstraintType GetConstraintType() => Jolt.PInvoke.TwoBodyConstraint_GetConstraintType(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:38
///
/// virtual bool IsActive() const override
///
///
///
///
/// Solver interface
///
///
public bool IsActive() => Jolt.PInvoke.TwoBodyConstraint_IsActive(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:40
///
/// virtual void DrawConstraintReferenceFrame(DebugRenderer *inRenderer) const override
///
///
public void DrawConstraintReferenceFrame(DebugRenderer renderer) => Jolt.PInvoke.TwoBodyConstraint_DrawConstraintReferenceFrame(this, renderer);
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:44
///
/// Body * GetBody1() const
///
///
///
///
/// Access to the connected bodies
///
///
/// 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);
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:48
///
/// virtual Mat44 GetConstraintToBody1Matrix() const = 0
///
///
///
///
/// 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.
///
///
public float4x4 GetConstraintToBody1Matrix() => Jolt.PInvoke.TwoBodyConstraint_GetConstraintToBody1Matrix(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:51
///
/// virtual Mat44 GetConstraintToBody2Matrix() const = 0
///
///
///
///
/// 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.
///
///
public float4x4 GetConstraintToBody2Matrix() => Jolt.PInvoke.TwoBodyConstraint_GetConstraintToBody2Matrix(this);
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:54
///
/// virtual void BuildIslands(uint32 inConstraintIndex, IslandBuilder &ioBuilder, BodyManager &inBodyManager) override
///
///
///
///
/// Link bodies that are connected by this constraint in the island builder
///
///
public void BuildIslands(uint constraintIndex, IslandBuilder builder, BodyManager bodyManager) => Jolt.PInvoke.TwoBodyConstraint_BuildIslands(this, constraintIndex, builder, bodyManager);
///
///
/// C++:
/// Jolt/Physics/Constraints/TwoBodyConstraint.h:57
///
/// virtual uint BuildIslandSplits(LargeIslandSplitter &ioSplitter) const override
///
///
///
///
/// Link bodies that are connected by this constraint in the same split. Returns the split index.
///
///
public uint BuildIslandSplits(LargeIslandSplitter splitter) => Jolt.PInvoke.TwoBodyConstraint_BuildIslandSplits(this, splitter);
public void AddRef() => Jolt.PInvoke.TwoBodyConstraint_AddRef(this);
public void Release() => Jolt.PInvoke.TwoBodyConstraint_Release(this);
public uint GetRefCount() => Jolt.PInvoke.TwoBodyConstraint_GetRefCount(this);
public static implicit operator Constraint(TwoBodyConstraint value) => Jolt.PInvoke.TwoBodyConstraint_AsConstraint(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}