< Summary

Information
Class: FixedMathSharp.Geometry.TriangleConeContactSelection
Assembly: FixedMathSharp
File(s): /home/runner/work/FixedMathSharp/FixedMathSharp/src/FixedMathSharp/Geometry/Wide/Triangles/TriangleConeContactSelection.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 37
Line coverage: 100%
Branch coverage
100%
Covered branches: 8
Total branches: 8
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%
get_Separated()100%22100%
get_Candidate()100%11100%
Keep(...)100%66100%

File(s)

/home/runner/work/FixedMathSharp/FixedMathSharp/src/FixedMathSharp/Geometry/Wide/Triangles/TriangleConeContactSelection.cs

#LineLine coverage
 1//=======================================================================
 2// TriangleConeContactSelection.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2024-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8using System;
 9
 10namespace FixedMathSharp.Geometry;
 11
 12/// <summary>One exact cone support winner and its unrounded local normal.</summary>
 13internal ref struct TriangleConeContactSelection
 14{
 15    internal const int Apex = 0, BasePole = 1, BaseRim = 2, Generator = 3;
 16    internal Span<ulong> Values;
 17    internal Span<int> Signs;
 18    internal int GapSign, Mask, Feature;
 19    internal bool HasValue;
 20    internal TriangleConeContactSelection(Span<ulong> values, Span<int> signs)
 21    {
 27422        Values = values; Signs = signs;
 27423        GapSign = Mask = Feature = 0; HasValue = false;
 13724    }
 25
 975026    internal readonly bool Separated => HasValue && GapSign < 0;
 426327    internal readonly ConvexContactCandidate Candidate => new(Values, Signs, GapSign);
 28
 29    internal void Keep(scoped Span<ulong> values, scoped Span<int> signs, int gapSign, int mask, int feature)
 30    {
 407631        if (Separated || HasValue && WideConvexPrismRelations.CompareConvexContactCandidates(
 407632                new ConvexContactCandidate(values, signs, gapSign), Candidate) >= 0)
 371433            return;
 72434        values.CopyTo(Values); signs.CopyTo(Signs);
 144835        GapSign = gapSign; Mask = mask; Feature = feature; HasValue = true;
 36236    }
 37}