< Summary

Information
Class: Gravitas.Colliders.ConeGeometry
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Colliders/3D/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/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 FixedMathSharp;
 9using FixedMathSharp.Geometry;
 10using System.Runtime.CompilerServices;
 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    {
 46228        Vector3d normal = axis.MagnitudeSquared > Fixed64.Epsilon
 46229            ? axis.Normalized
 46230            : Vector3d.Up;
 46231        FixedBoundBox bounds = FixedBoundBox.FromFiniteConeClippedToDomain(
 46232            apex,
 46233            baseCenter,
 46234            normal,
 46235            baseRadius);
 46236        min = bounds.Min;
 46237        max = bounds.Max;
 46238    }
 39}