< Summary

Information
Class: Gravitas.Constraints.RagdollJointDefinition2D
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Constraints/2D/RagdollJointDefinition2D.cs
Line coverage
100%
Covered lines: 19
Uncovered lines: 0
Coverable lines: 19
Total lines: 98
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/Constraints/2D/RagdollJointDefinition2D.cs

#LineLine coverage
 1//=======================================================================
 2// RagdollJointDefinition2D.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2026-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8namespace Gravitas.Constraints;
 9
 10/// <summary>
 11/// Authored joint entry for a deterministic pure 2D ragdoll articulation.
 12/// </summary>
 13public readonly struct RagdollJointDefinition2D
 14{
 15    /// <summary>
 16    /// Creates a ragdoll joint definition with unrestricted limits, no motor, and adjacent self-collision suppression.
 17    /// </summary>
 18    public RagdollJointDefinition2D(
 19        int linkAId,
 20        int linkBId,
 21        JointType2D type,
 22        JointFrame2D localFrameA,
 23        JointFrame2D localFrameB)
 2724        : this(
 2725            linkAId,
 2726            linkBId,
 2727            type,
 2728            localFrameA,
 2729            localFrameB,
 2730            JointLimit2D.Unrestricted,
 2731            JointMotor2D.Disabled,
 2732            JointCollisionPolicy.SuppressLinked)
 33    {
 2734    }
 35
 36    /// <summary>
 37    /// Creates a pure 2D ragdoll joint definition.
 38    /// </summary>
 39    public RagdollJointDefinition2D(
 40        int linkAId,
 41        int linkBId,
 42        JointType2D type,
 43        JointFrame2D localFrameA,
 44        JointFrame2D localFrameB,
 45        JointLimit2D limits,
 46        JointMotor2D motor,
 47        JointCollisionPolicy collisionPolicy)
 48    {
 2849        LinkAId = linkAId;
 2850        LinkBId = linkBId;
 2851        Type = type;
 2852        LocalFrameA = localFrameA;
 2853        LocalFrameB = localFrameB;
 2854        Limits = limits;
 2855        Motor = motor;
 2856        CollisionPolicy = collisionPolicy;
 2857    }
 58
 59    /// <summary>
 60    /// Gets the first authored link ID.
 61    /// </summary>
 62    public int LinkAId { get; }
 63
 64    /// <summary>
 65    /// Gets the second authored link ID.
 66    /// </summary>
 67    public int LinkBId { get; }
 68
 69    /// <summary>
 70    /// Gets the joint type.
 71    /// </summary>
 72    public JointType2D Type { get; }
 73
 74    /// <summary>
 75    /// Gets the local frame for the first link.
 76    /// </summary>
 77    public JointFrame2D LocalFrameA { get; }
 78
 79    /// <summary>
 80    /// Gets the local frame for the second link.
 81    /// </summary>
 82    public JointFrame2D LocalFrameB { get; }
 83
 84    /// <summary>
 85    /// Gets optional scalar limit data.
 86    /// </summary>
 87    public JointLimit2D Limits { get; }
 88
 89    /// <summary>
 90    /// Gets optional scalar motor data.
 91    /// </summary>
 92    public JointMotor2D Motor { get; }
 93
 94    /// <summary>
 95    /// Gets physical collision filtering behavior for the linked colliders.
 96    /// </summary>
 97    public JointCollisionPolicy CollisionPolicy { get; }
 98}