Skip to content

Commit

Permalink
Add swing twist constraint bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
seep committed Sep 15, 2024
1 parent 1cbee45 commit c518d15
Show file tree
Hide file tree
Showing 12 changed files with 237 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Jolt/Bindings/Bindings_JPH_SwingTwistConstraint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Unity.Mathematics;

namespace Jolt
{
internal static unsafe partial class Bindings
{
public static float JPH_SwingTwistConstraint_GetNormalHalfConeAngle(NativeHandle<JPH_SwingTwistConstraint> constraint)
{
return UnsafeBindings.JPH_SwingTwistConstraint_GetNormalHalfConeAngle(constraint);
}

public static float3 JPH_SwingTwistConstraint_GetTotalLambdaPosition(NativeHandle<JPH_SwingTwistConstraint> constraint)
{
float3 result;
UnsafeBindings.JPH_SwingTwistConstraint_GetTotalLambdaPosition(constraint, &result);
return result;
}

public static float JPH_SwingTwistConstraint_GetTotalLambdaTwist(NativeHandle<JPH_SwingTwistConstraint> constraint)
{
return UnsafeBindings.JPH_SwingTwistConstraint_GetTotalLambdaTwist(constraint);
}

public static float JPH_SwingTwistConstraint_GetTotalLambdaSwingY(NativeHandle<JPH_SwingTwistConstraint> constraint)
{
return UnsafeBindings.JPH_SwingTwistConstraint_GetTotalLambdaSwingY(constraint);
}

public static float JPH_SwingTwistConstraint_GetTotalLambdaSwingZ(NativeHandle<JPH_SwingTwistConstraint> constraint)
{
return UnsafeBindings.JPH_SwingTwistConstraint_GetTotalLambdaSwingZ(constraint);
}

public static float3 JPH_SwingTwistConstraint_GetTotalLambdaMotor(NativeHandle<JPH_SwingTwistConstraint> constraint)
{
float3 result;
UnsafeBindings.JPH_SwingTwistConstraint_GetTotalLambdaMotor(constraint, &result);
return result;
}
}
}
3 changes: 3 additions & 0 deletions Jolt/Bindings/Bindings_JPH_SwingTwistConstraint.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Jolt/Bindings/Bindings_JPH_SwingTwistConstraintSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Jolt
{
internal static unsafe partial class Bindings
{
public static NativeHandle<JPH_SwingTwistConstraintSettings> JPH_SwingTwistConstraintSettings_Create()
{
return CreateHandle(UnsafeBindings.JPH_SwingTwistConstraintSettings_Create());
}

public static NativeHandle<JPH_SwingTwistConstraint> JPH_SwingTwistConstraintSettings_CreateConstraint(NativeHandle<JPH_SwingTwistConstraintSettings> settings, NativeHandle<JPH_Body> bodyA, NativeHandle<JPH_Body> bodyB)
{
return CreateHandle(UnsafeBindings.JPH_SwingTwistConstraintSettings_CreateConstraint(settings, bodyA, bodyB));
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions Jolt/Generated/SwingTwistConstraint.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System;
using Jolt;
using Unity.Mathematics;

namespace Jolt
{
public readonly partial struct SwingTwistConstraint : IEquatable<SwingTwistConstraint>
{
internal readonly NativeHandle<JPH_SwingTwistConstraint> Handle;

internal SwingTwistConstraint(NativeHandle<JPH_SwingTwistConstraint> handle) => Handle = handle;

#region IEquatable

public bool Equals(SwingTwistConstraint other) => Handle.Equals(other.Handle);

public override bool Equals(object obj) => obj is SwingTwistConstraint other && Equals(other);

public override int GetHashCode() => Handle.GetHashCode();

public static bool operator ==(SwingTwistConstraint lhs, SwingTwistConstraint rhs) => lhs.Equals(rhs);

public static bool operator !=(SwingTwistConstraint lhs, SwingTwistConstraint rhs) => !lhs.Equals(rhs);

#endregion

#region JPH_SwingTwistConstraint

public float GetNormalHalfConeAngle() => Bindings.JPH_SwingTwistConstraint_GetNormalHalfConeAngle(Handle);

public float3 GetTotalLambdaPosition() => Bindings.JPH_SwingTwistConstraint_GetTotalLambdaPosition(Handle);

public float GetTotalLambdaTwist() => Bindings.JPH_SwingTwistConstraint_GetTotalLambdaTwist(Handle);

public float GetTotalLambdaSwingY() => Bindings.JPH_SwingTwistConstraint_GetTotalLambdaSwingY(Handle);

public float GetTotalLambdaSwingZ() => Bindings.JPH_SwingTwistConstraint_GetTotalLambdaSwingZ(Handle);

public float3 GetTotalLambdaMotor() => Bindings.JPH_SwingTwistConstraint_GetTotalLambdaMotor(Handle);

#endregion

#region JPH_Constraint

public ConstraintSettings GetConstraintSettings() => new ConstraintSettings(Bindings.JPH_Constraint_GetConstraintSettings(Handle.Reinterpret<JPH_Constraint>()));

public new ConstraintType GetType() => Bindings.JPH_Constraint_GetType(Handle.Reinterpret<JPH_Constraint>());

public ConstraintSubType GetSubType() => Bindings.JPH_Constraint_GetSubType(Handle.Reinterpret<JPH_Constraint>());

public uint GetConstraintPriority() => Bindings.JPH_Constraint_GetConstraintPriority(Handle.Reinterpret<JPH_Constraint>());

public void SetConstraintPriority(uint priority) => Bindings.JPH_Constraint_SetConstraintPriority(Handle.Reinterpret<JPH_Constraint>(), priority);

public bool GetEnabled() => Bindings.JPH_Constraint_GetEnabled(Handle.Reinterpret<JPH_Constraint>());

public void SetEnabled(bool enabled) => Bindings.JPH_Constraint_SetEnabled(Handle.Reinterpret<JPH_Constraint>(), enabled);

public ulong GetUserData() => Bindings.JPH_Constraint_GetUserData(Handle.Reinterpret<JPH_Constraint>());

public void SetUserData(ulong userData) => Bindings.JPH_Constraint_SetUserData(Handle.Reinterpret<JPH_Constraint>(), userData);

public void NotifyShapeChanged(BodyID bodyID, float3 deltaCOM) => Bindings.JPH_Constraint_NotifyShapeChanged(Handle.Reinterpret<JPH_Constraint>(), bodyID, deltaCOM);

public void Destroy() => Bindings.JPH_Constraint_Destroy(Handle.Reinterpret<JPH_Constraint>());

#endregion

}
}
11 changes: 11 additions & 0 deletions Jolt/Generated/SwingTwistConstraint.g.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions Jolt/Generated/SwingTwistConstraintSettings.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using Jolt;
using Unity.Mathematics;

namespace Jolt
{
public readonly partial struct SwingTwistConstraintSettings : IEquatable<SwingTwistConstraintSettings>
{
internal readonly NativeHandle<JPH_SwingTwistConstraintSettings> Handle;

internal SwingTwistConstraintSettings(NativeHandle<JPH_SwingTwistConstraintSettings> handle) => Handle = handle;

#region IEquatable

public bool Equals(SwingTwistConstraintSettings other) => Handle.Equals(other.Handle);

public override bool Equals(object obj) => obj is SwingTwistConstraintSettings other && Equals(other);

public override int GetHashCode() => Handle.GetHashCode();

public static bool operator ==(SwingTwistConstraintSettings lhs, SwingTwistConstraintSettings rhs) => lhs.Equals(rhs);

public static bool operator !=(SwingTwistConstraintSettings lhs, SwingTwistConstraintSettings rhs) => !lhs.Equals(rhs);

#endregion

#region JPH_SwingTwistConstraintSettings

public SwingTwistConstraint CreateConstraint(Body bodyA, Body bodyB) => new SwingTwistConstraint(Bindings.JPH_SwingTwistConstraintSettings_CreateConstraint(Handle, bodyA.Handle, bodyB.Handle));

#endregion

#region JPH_ConstraintSettings

public void Destroy() => Bindings.JPH_ConstraintSettings_Destroy(Handle.Reinterpret<JPH_ConstraintSettings>());

public bool GetEnabled() => Bindings.JPH_ConstraintSettings_GetEnabled(Handle.Reinterpret<JPH_ConstraintSettings>());

public uint GetConstraintPriority() => Bindings.JPH_ConstraintSettings_GetConstraintPriority(Handle.Reinterpret<JPH_ConstraintSettings>());

public uint GetNumVelocityStepsOverride() => Bindings.JPH_ConstraintSettings_GetNumVelocityStepsOverride(Handle.Reinterpret<JPH_ConstraintSettings>());

public void SetNumVelocityStepsOverride(uint value) => Bindings.JPH_ConstraintSettings_SetNumVelocityStepsOverride(Handle.Reinterpret<JPH_ConstraintSettings>(), value);

public uint GetNumPositionStepsOverride() => Bindings.JPH_ConstraintSettings_GetNumPositionStepsOverride(Handle.Reinterpret<JPH_ConstraintSettings>());

public void SetNumPositionStepsOverride(uint value) => Bindings.JPH_ConstraintSettings_SetNumPositionStepsOverride(Handle.Reinterpret<JPH_ConstraintSettings>(), value);

public float GetDrawConstraintSize() => Bindings.JPH_ConstraintSettings_GetDrawConstraintSize(Handle.Reinterpret<JPH_ConstraintSettings>());

public void SetDrawConstraintSize(float value) => Bindings.JPH_ConstraintSettings_SetDrawConstraintSize(Handle.Reinterpret<JPH_ConstraintSettings>(), value);

public ulong GetUserData() => Bindings.JPH_ConstraintSettings_GetUserData(Handle.Reinterpret<JPH_ConstraintSettings>());

public void SetUserData(ulong value) => Bindings.JPH_ConstraintSettings_SetUserData(Handle.Reinterpret<JPH_ConstraintSettings>(), value);

#endregion

}
}
11 changes: 11 additions & 0 deletions Jolt/Generated/SwingTwistConstraintSettings.g.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Jolt/Physics/Constraints/SwingTwistConstraint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace Jolt
{
[GenerateHandle("JPH_SwingTwistConstraint"), GenerateBindings("JPH_SwingTwistConstraint", "JPH_Constraint")]
public readonly partial struct SwingTwistConstraint { }
}
3 changes: 3 additions & 0 deletions Jolt/Physics/Constraints/SwingTwistConstraint.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Jolt/Physics/Constraints/SwingTwistConstraintSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Jolt
{
[GenerateHandle("JPH_SwingTwistConstraintSettings"), GenerateBindings("JPH_SwingTwistConstraintSettings", "JPH_ConstraintSettings")]
public readonly partial struct SwingTwistConstraintSettings
{
[OverrideBinding("JPH_SwingTwistConstraintSettings_Create")]
public static SwingTwistConstraintSettings Create()
{
return new SwingTwistConstraintSettings(Bindings.JPH_SwingTwistConstraintSettings_Create());
}
}
}
3 changes: 3 additions & 0 deletions Jolt/Physics/Constraints/SwingTwistConstraintSettings.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c518d15

Please sign in to comment.