mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
239 lines
12 KiB
C#
239 lines
12 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L69">Jolt/Physics/Constraints/ConeConstraint.h:69</see>
|
|
/// <br/>
|
|
/// <c>class ConeConstraint final : public TwoBodyConstraint</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// A cone constraint constraints 2 bodies to a single point and limits the swing between the twist axis within a cone:
|
|
///
|
|
/// t1 . t2 &lt;= cos(theta)
|
|
///
|
|
/// Where:
|
|
///
|
|
/// t1 = twist axis of body 1.
|
|
/// t2 = twist axis of body 2.
|
|
/// theta = half cone angle (angle from the principal axis of the cone to the edge).
|
|
///
|
|
/// Calculating the Jacobian:
|
|
///
|
|
/// Constraint equation:
|
|
///
|
|
/// C = t1 . t2 - cos(theta)
|
|
///
|
|
/// Derivative:
|
|
///
|
|
/// d/dt C = d/dt (t1 . t2) = (d/dt t1) . t2 + t1 . (d/dt t2) = (w1 x t1) . t2 + t1 . (w2 x t2) = (t1 x t2) . w1 + (t2 x t1) . w2
|
|
///
|
|
/// d/dt C = J v = [0, -t2 x t1, 0, t2 x t1] [v1, w1, v2, w2]
|
|
///
|
|
/// Where J is the Jacobian.
|
|
///
|
|
/// Note that this is the exact same equation as used in AngleConstraintPart if we use t2 x t1 as the world space axis
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct ConeConstraint : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L75">Jolt/Physics/Constraints/ConeConstraint.h:75</see>
|
|
/// <br/>
|
|
/// <c>ConeConstraint(Body &inBody1, Body &inBody2, const ConeConstraintSettings &inSettings)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Construct cone constraint
|
|
/// </para>
|
|
/// </remarks>
|
|
public static ConeConstraint Create(Body body1, Body body2, ConeConstraintSettings settings) => Jolt.PInvoke.ConeConstraint_Create(body1, body2, settings);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L78">Jolt/Physics/Constraints/ConeConstraint.h:78</see>
|
|
/// <br/>
|
|
/// <c>virtual EConstraintSubType GetSubType() const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Generic interface of a constraint
|
|
/// </para>
|
|
/// </remarks>
|
|
public EConstraintSubType GetSubType() => Jolt.PInvoke.ConeConstraint_GetSubType(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L79">Jolt/Physics/Constraints/ConeConstraint.h:79</see>
|
|
/// <br/>
|
|
/// <c>virtual void NotifyShapeChanged(const BodyID &inBodyID, Vec3Arg inDeltaCOM) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void NotifyShapeChanged(uint bodyID, float3 deltaCOM) => Jolt.PInvoke.ConeConstraint_NotifyShapeChanged(this, bodyID, deltaCOM);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L80">Jolt/Physics/Constraints/ConeConstraint.h:80</see>
|
|
/// <br/>
|
|
/// <c>virtual void SetupVelocityConstraint(float inDeltaTime) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetupVelocityConstraint(float deltaTime) => Jolt.PInvoke.ConeConstraint_SetupVelocityConstraint(this, deltaTime);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L81">Jolt/Physics/Constraints/ConeConstraint.h:81</see>
|
|
/// <br/>
|
|
/// <c>virtual void ResetWarmStart() override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void ResetWarmStart() => Jolt.PInvoke.ConeConstraint_ResetWarmStart(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L82">Jolt/Physics/Constraints/ConeConstraint.h:82</see>
|
|
/// <br/>
|
|
/// <c>virtual void WarmStartVelocityConstraint(float inWarmStartImpulseRatio) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void WarmStartVelocityConstraint(float warmStartImpulseRatio) => Jolt.PInvoke.ConeConstraint_WarmStartVelocityConstraint(this, warmStartImpulseRatio);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L83">Jolt/Physics/Constraints/ConeConstraint.h:83</see>
|
|
/// <br/>
|
|
/// <c>virtual bool SolveVelocityConstraint(float inDeltaTime) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool SolveVelocityConstraint(float deltaTime) => Jolt.PInvoke.ConeConstraint_SolveVelocityConstraint(this, deltaTime);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L84">Jolt/Physics/Constraints/ConeConstraint.h:84</see>
|
|
/// <br/>
|
|
/// <c>virtual bool SolvePositionConstraint(float inDeltaTime, float inBaumgarte) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool SolvePositionConstraint(float deltaTime, float baumgarte) => Jolt.PInvoke.ConeConstraint_SolvePositionConstraint(this, deltaTime, baumgarte);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L86">Jolt/Physics/Constraints/ConeConstraint.h:86</see>
|
|
/// <br/>
|
|
/// <c>virtual void DrawConstraint(DebugRenderer *inRenderer) const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawConstraint(DebugRenderer renderer) => Jolt.PInvoke.ConeConstraint_DrawConstraint(this, renderer);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L87">Jolt/Physics/Constraints/ConeConstraint.h:87</see>
|
|
/// <br/>
|
|
/// <c>virtual void DrawConstraintLimits(DebugRenderer *inRenderer) const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void DrawConstraintLimits(DebugRenderer renderer) => Jolt.PInvoke.ConeConstraint_DrawConstraintLimits(this, renderer);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L91">Jolt/Physics/Constraints/ConeConstraint.h:91</see>
|
|
/// <br/>
|
|
/// <c>virtual Ref<ConstraintSettings> GetConstraintSettings() const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public ConstraintSettings GetConstraintSettings() => Jolt.PInvoke.ConeConstraint_GetConstraintSettings(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L94">Jolt/Physics/Constraints/ConeConstraint.h:94</see>
|
|
/// <br/>
|
|
/// <c>virtual Mat44 GetConstraintToBody1Matrix() const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See: TwoBodyConstraint
|
|
/// </para>
|
|
/// </remarks>
|
|
public float4x4 GetConstraintToBody1Matrix() => Jolt.PInvoke.ConeConstraint_GetConstraintToBody1Matrix(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L95">Jolt/Physics/Constraints/ConeConstraint.h:95</see>
|
|
/// <br/>
|
|
/// <c>virtual Mat44 GetConstraintToBody2Matrix() const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float4x4 GetConstraintToBody2Matrix() => Jolt.PInvoke.ConeConstraint_GetConstraintToBody2Matrix(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L98">Jolt/Physics/Constraints/ConeConstraint.h:98</see>
|
|
/// <br/>
|
|
/// <c>void SetHalfConeAngle(float inHalfConeAngle)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Update maximum angle between body 1 and 2 (see ConeConstraintSettings)
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SetHalfConeAngle(float halfConeAngle) => Jolt.PInvoke.ConeConstraint_SetHalfConeAngle(this, halfConeAngle);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L99">Jolt/Physics/Constraints/ConeConstraint.h:99</see>
|
|
/// <br/>
|
|
/// <c>float GetCosHalfConeAngle() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetCosHalfConeAngle() => Jolt.PInvoke.ConeConstraint_GetCosHalfConeAngle(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L102">Jolt/Physics/Constraints/ConeConstraint.h:102</see>
|
|
/// <br/>
|
|
/// <c>inline Vec3 GetTotalLambdaPosition() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// @name Get Lagrange multiplier from last physics update (the linear/angular impulse applied to satisfy
|
|
/// the constraint)
|
|
/// </para>
|
|
/// </remarks>
|
|
public float3 GetTotalLambdaPosition() => Jolt.PInvoke.ConeConstraint_GetTotalLambdaPosition(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Constraints/ConeConstraint.h#L103">Jolt/Physics/Constraints/ConeConstraint.h:103</see>
|
|
/// <br/>
|
|
/// <c>inline float GetTotalLambdaRotation() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetTotalLambdaRotation() => Jolt.PInvoke.ConeConstraint_GetTotalLambdaRotation(this);
|
|
public void AddRef() => Jolt.PInvoke.ConeConstraint_AddRef(this);
|
|
public void Release() => Jolt.PInvoke.ConeConstraint_Release(this);
|
|
public uint GetRefCount() => Jolt.PInvoke.ConeConstraint_GetRefCount(this);
|
|
public static implicit operator TwoBodyConstraint(ConeConstraint value) => Jolt.PInvoke.ConeConstraint_AsTwoBodyConstraint(value);
|
|
public static implicit operator Constraint(ConeConstraint value) => Jolt.PInvoke.ConeConstraint_AsConstraint(value);
|
|
public void Dispose()
|
|
{
|
|
if (IsNull()) return;
|
|
Release();
|
|
}
|
|
}
|
|
}
|