//
// 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
{
///
///
/// A point constraint constrains 2 bodies on a single point (removing 3 degrees of freedom)
///
///
/// C++:
/// Jolt/Physics/Constraints/PointConstraint.h:40
///
/// class PointConstraint final : public TwoBodyConstraint
///
///
[InteropHandle]
public readonly partial struct PointConstraint : IDisposable
{
///
///
/// Construct point constraint
///
///
/// C++:
/// Jolt/Physics/Constraints/PointConstraint.h:46
///
/// PointConstraint(Body &inBody1, Body &inBody2, const PointConstraintSettings &inSettings)
///
///
public static PointConstraint Create(Body body1, Body body2, PointConstraintSettings settings) =>
Jolt.PInvoke.PointConstraint_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 ConstraintSettings GetConstraintSettings() => ((Constraint)this).GetConstraintSettings();
///
///
/// Update the attachment point for body 1
///
///
/// C++:
/// Jolt/Physics/Constraints/PointConstraint.h:64
///
/// void SetPoint1(EConstraintSpace inSpace, RVec3Arg inPoint1)
///
///
public void SetPoint1(ConstraintSpace space, float3 point1) =>
Jolt.PInvoke.PointConstraint_SetPoint1(this, space, point1);
///
///
/// Update the attachment point for body 2
///
///
/// C++:
/// Jolt/Physics/Constraints/PointConstraint.h:67
///
/// void SetPoint2(EConstraintSpace inSpace, RVec3Arg inPoint2)
///
///
public void SetPoint2(ConstraintSpace space, float3 point2) =>
Jolt.PInvoke.PointConstraint_SetPoint2(this, space, point2);
///
///
/// Get the attachment point for body 1 relative to body 1 COM (transform by Body::GetCenterOfMassTransform
/// to take to world space)
///
///
/// C++:
/// Jolt/Physics/Constraints/PointConstraint.h:70
///
/// inline Vec3 GetLocalSpacePoint1() const
///
///
public float3 GetLocalSpacePoint1() => Jolt.PInvoke.PointConstraint_GetLocalSpacePoint1(this);
///
///
/// Get the attachment point for body 2 relative to body 2 COM (transform by Body::GetCenterOfMassTransform
/// to take to world space)
///
///
/// C++:
/// Jolt/Physics/Constraints/PointConstraint.h:73
///
/// inline Vec3 GetLocalSpacePoint2() const
///
///
public float3 GetLocalSpacePoint2() => Jolt.PInvoke.PointConstraint_GetLocalSpacePoint2(this);
///
public float4x4 GetConstraintToBody1Matrix() => ((TwoBodyConstraint)this).GetConstraintToBody1Matrix();
///
public float4x4 GetConstraintToBody2Matrix() => ((TwoBodyConstraint)this).GetConstraintToBody2Matrix();
///
///
/// C++:
/// Jolt/Physics/Constraints/PointConstraint.h:80
///
/// inline Vec3 GetTotalLambdaPosition() const
///
///
///
///
/// @name Get Lagrange multiplier from last physics update (the linear impulse applied to satisfy the
/// constraint)
///
///
public float3 GetTotalLambdaPosition() => Jolt.PInvoke.PointConstraint_GetTotalLambdaPosition(this);
public void AddRef() => ((Constraint)this).AddRef();
public void Release() => ((Constraint)this).Release();
public uint GetRefCount() => ((Constraint)this).GetRefCount();
public static implicit operator TwoBodyConstraint(PointConstraint value) =>
Unsafe.BitCast(value);
public static implicit operator Constraint(PointConstraint 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 bool IsActive() => ((Constraint)this).IsActive();
///
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);
}
}