< Summary

Information
Class: Gravitas.Colliders.ConeGeometry
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Colliders/3D/Shapes/ConeGeometry.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 39
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
CreateFiniteConeBounds(...)100%22100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/Colliders/3D/Shapes/ConeGeometry.cs

#LineLine coverage
 1//=======================================================================
 2// ConeGeometry.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 System.Runtime.CompilerServices;
 9using FixedMathSharp;
 10using FixedMathSharp.Geometry;
 11
 12namespace Gravitas.Colliders;
 13
 14/// <summary>
 15/// Shared deterministic finite-cone geometry helpers.
 16/// </summary>
 17internal static class ConeGeometry
 18{
 19    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 20    public static void CreateFiniteConeBounds(
 21        Vector3d apex,
 22        Vector3d baseCenter,
 23        Vector3d axis,
 24        Fixed64 baseRadius,
 25        out Vector3d min,
 26        out Vector3d max)
 27    {
 96728        Vector3d normal = axis.MagnitudeSquared > Fixed64.Epsilon
 96729            ? axis.Normalized
 96730            : Vector3d.Up;
 96731        FixedBoundBox bounds = FixedBoundBox.FromFiniteConeClippedToDomain(
 96732            apex,
 96733            baseCenter,
 96734            normal,
 96735            baseRadius);
 96736        min = bounds.Min;
 96737        max = bounds.Max;
 96738    }
 39}