< Summary

Information
Class: SwiftCollections.Query.FixedBoundVolumeFactory
Assembly: SwiftCollections.FixedMathSharp
File(s): /home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections.FixedMathSharp/Query/Shared/Volume/FixedBoundVolumeFactory.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
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
Create(...)100%11100%
Create(...)100%11100%
Create(...)100%11100%

File(s)

/home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections.FixedMathSharp/Query/Shared/Volume/FixedBoundVolumeFactory.cs

#LineLine coverage
 1//=======================================================================
 2// FixedBoundVolumeFactory.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 FixedMathSharp.Bounds;
 9using System.Runtime.CompilerServices;
 10
 11namespace SwiftCollections.Query;
 12
 13/// <summary>
 14/// Creates <see cref="FixedBoundVolume"/> instances from FixedMathSharp bounds types.
 15/// </summary>
 16public static class FixedBoundVolumeFactory
 17{
 18    /// <summary>
 19    /// Creates a fixed query volume from a FixedMathSharp bounding box.
 20    /// </summary>
 21    /// <param name="bounds">The source bounding box.</param>
 22    /// <returns>A query volume using the source bounds minimum and maximum corners.</returns>
 23    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 124    public static FixedBoundVolume Create(FixedBoundBox bounds) => new(bounds.Min, bounds.Max);
 25
 26    /// <summary>
 27    /// Creates a fixed query volume from a FixedMathSharp bounding sphere.
 28    /// </summary>
 29    /// <param name="bounds">The source bounding sphere.</param>
 30    /// <returns>A query volume using the sphere's enclosing minimum and maximum corners.</returns>
 31    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 132    public static FixedBoundVolume Create(FixedBoundSphere bounds) => new(bounds.Min, bounds.Max);
 33
 34    /// <summary>
 35    /// Creates a fixed query volume from a FixedMathSharp bounding frustum.
 36    /// </summary>
 37    /// <param name="bounds">The source bounding frustum.</param>
 38    /// <returns>A query volume using the frustum's enclosing minimum and maximum corners.</returns>
 39    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 140    public static FixedBoundVolume Create(FixedBoundFrustum bounds) => new(bounds.Min, bounds.Max);
 41}