< Summary

Information
Class: Gravitas.CollisionHandling.ContactLever3D
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/CollisionHandling/Response/3D/ContactLever3D.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 36
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

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

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/CollisionHandling/Response/3D/ContactLever3D.cs

#LineLine coverage
 1//=======================================================================
 2// ContactLever3D.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.CollisionHandling;
 11
 12/// <summary>
 13/// Carries a 3D contact lever or signals that the solver must use exact anchor arithmetic.
 14/// </summary>
 15internal readonly struct ContactLever3D
 16{
 17    private ContactLever3D(Vector3d vector, bool isExact)
 18    {
 78091819        Vector = vector;
 78091820        IsExact = isExact;
 78091821    }
 22
 23    internal bool IsExact { get; }
 24
 25    internal Vector3d Vector { get; }
 26
 27    internal static ContactLever3D Create(
 28        in ContactAnchor point,
 29        in ContactAnchor origin)
 30    {
 78091831        if (point.TryGetOffsetFrom(origin, out Vector3d vector))
 78086932            return new ContactLever3D(vector, isExact: false);
 33
 4934        return new ContactLever3D(default, isExact: true);
 35    }
 36}