< Summary

Information
Class: Gravitas.Constraints.JointDefinition2D
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Constraints/2D/JointDefinition2D.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 77
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%

File(s)

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

#LineLine coverage
 1//=======================================================================
 2// JointDefinition2D.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 payload used to register one context-owned deterministic pure 2D joint.
 12/// </summary>
 13public readonly struct JointDefinition2D
 14{
 15    /// <summary>
 16    /// Creates a pure 2D joint definition.
 17    /// </summary>
 18    public JointDefinition2D(
 19        SolidBody2D bodyA,
 20        SolidBody2D bodyB,
 21        JointFrame2D localFrameA,
 22        JointFrame2D localFrameB,
 23        JointType2D type,
 24        JointLimit2D limits,
 25        JointMotor2D motor,
 26        JointCollisionPolicy collisionPolicy)
 27    {
 22528        BodyA = bodyA;
 22529        BodyB = bodyB;
 22530        LocalFrameA = localFrameA;
 22531        LocalFrameB = localFrameB;
 22532        Type = type;
 22533        Limits = limits;
 22534        Motor = motor;
 22535        CollisionPolicy = collisionPolicy;
 22536    }
 37
 38    /// <summary>
 39    /// Gets the first body linked by the joint.
 40    /// </summary>
 41    public SolidBody2D BodyA { get; }
 42
 43    /// <summary>
 44    /// Gets the second body linked by the joint.
 45    /// </summary>
 46    public SolidBody2D BodyB { get; }
 47
 48    /// <summary>
 49    /// Gets the first local anchor frame. Values are copied at registration time.
 50    /// </summary>
 51    public JointFrame2D LocalFrameA { get; }
 52
 53    /// <summary>
 54    /// Gets the second local anchor frame. Values are copied at registration time.
 55    /// </summary>
 56    public JointFrame2D LocalFrameB { get; }
 57
 58    /// <summary>
 59    /// Gets the joint type.
 60    /// </summary>
 61    public JointType2D Type { get; }
 62
 63    /// <summary>
 64    /// Gets optional scalar limit data.
 65    /// </summary>
 66    public JointLimit2D Limits { get; }
 67
 68    /// <summary>
 69    /// Gets optional scalar motor data.
 70    /// </summary>
 71    public JointMotor2D Motor { get; }
 72
 73    /// <summary>
 74    /// Gets physical collision filtering behavior for the linked colliders.
 75    /// </summary>
 76    public JointCollisionPolicy CollisionPolicy { get; }
 77}