< Summary

Information
Class: Gravitas.Constraints.JointFrame3D
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Constraints/3D/JointFrame3D.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 41
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%
FromTransform(...)100%11100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/Constraints/3D/JointFrame3D.cs

#LineLine coverage
 1//=======================================================================
 2// JointFrame3D.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
 8using FixedMathSharp;
 9
 10namespace Gravitas.Constraints;
 11
 12/// <summary>
 13/// Immutable local anchor frame used by a 3D joint.
 14/// </summary>
 15public readonly struct JointFrame3D
 16{
 17    /// <summary>
 18    /// Creates a local joint frame.
 19    /// </summary>
 20    public JointFrame3D(Vector3d position, FixedQuaternion rotation)
 21    {
 63422        Position = position;
 63423        Rotation = rotation.Normalized;
 63424    }
 25
 26    /// <summary>
 27    /// Gets the local anchor position relative to the linked body.
 28    /// </summary>
 29    public Vector3d Position { get; }
 30
 31    /// <summary>
 32    /// Gets the local anchor orientation relative to the linked body.
 33    /// </summary>
 34    public FixedQuaternion Rotation { get; }
 35
 36    internal static JointFrame3D FromTransform(FixedTransform transform, string parameterName)
 37    {
 62438        SwiftThrowHelper.ThrowIfNull(transform, parameterName);
 62439        return new JointFrame3D(transform.LocalPosition, transform.LocalRotation);
 40    }
 41}