< Summary

Information
Class: Gravitas.Queries.PhysicsSweepCircleAgainst3DRequest
Assembly: Gravitas
File(s): /home/runner/work/Gravitas/Gravitas/src/Gravitas/Queries/Mixed/PhysicsMixedQueryRequests.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 157
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
.ctor(...)100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/Gravitas/Gravitas/src/Gravitas/Queries/Mixed/PhysicsMixedQueryRequests.cs

#LineLine coverage
 1//=======================================================================
 2// PhysicsMixedQueryRequests.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 Gravitas.Colliders;
 10using Gravitas.Support;
 11
 12namespace Gravitas.Queries;
 13
 14/// <summary>
 15/// Describes one mixed 3D swept-sphere query against embedded 2D slabs.
 16/// </summary>
 17public readonly struct PhysicsSweepSphereAgainst2DRequest
 18{
 19    /// <summary>
 20    /// Creates a mixed 3D sphere sweep against embedded 2D slabs.
 21    /// </summary>
 22    public PhysicsSweepSphereAgainst2DRequest(
 23        Vector3d start,
 24        Vector3d end,
 25        Fixed64 radius,
 26        PhysicsLayerMask layerMask,
 27        LSCollider? excludedCollider = null,
 28        bool includeTriggers = true)
 29    {
 30        Start = start;
 31        End = end;
 32        Radius = radius;
 33        LayerMask = layerMask;
 34        ExcludedCollider = excludedCollider;
 35        IncludeTriggers = includeTriggers;
 36    }
 37
 38    /// <summary>
 39    /// Creates a mixed 3D sphere sweep against all embedded 2D physics layers.
 40    /// </summary>
 41    public PhysicsSweepSphereAgainst2DRequest(Vector3d start, Vector3d end, Fixed64 radius)
 42        : this(start, end, radius, PhysicsLayerMask.All)
 43    {
 44    }
 45
 46    /// <summary>
 47    /// Gets the sphere center's world-space start.
 48    /// </summary>
 49    public Vector3d Start { get; }
 50
 51    /// <summary>
 52    /// Gets the sphere center's world-space end.
 53    /// </summary>
 54    public Vector3d End { get; }
 55
 56    /// <summary>
 57    /// Gets the swept sphere radius.
 58    /// </summary>
 59    public Fixed64 Radius { get; }
 60
 61    /// <summary>
 62    /// Gets the included 2D target layers.
 63    /// </summary>
 64    public PhysicsLayerMask LayerMask { get; }
 65
 66    /// <summary>
 67    /// Gets the optional 3D source collider used for mixed-collision filtering.
 68    /// </summary>
 69    public LSCollider? ExcludedCollider { get; }
 70
 71    /// <summary>
 72    /// Gets whether trigger targets are included.
 73    /// </summary>
 74    public bool IncludeTriggers { get; }
 75}
 76
 77/// <summary>
 78/// Describes one mixed 2D swept-circle query against 3D colliders.
 79/// </summary>
 80public readonly struct PhysicsSweepCircleAgainst3DRequest
 81{
 82    /// <summary>
 83    /// Creates a mixed 2D circle-slab sweep against 3D colliders.
 84    /// </summary>
 85    public PhysicsSweepCircleAgainst3DRequest(
 86        Vector2d start,
 87        Vector2d end,
 88        Fixed64 radius,
 89        Fixed64 slabCenterY,
 90        Fixed64 halfThickness,
 91        PhysicsLayerMask layerMask,
 92        LSCollider2D? excludedCollider = null,
 93        bool includeTriggers = true)
 94    {
 495        Start = start;
 496        End = end;
 497        Radius = radius;
 498        SlabCenterY = slabCenterY;
 499        HalfThickness = halfThickness;
 4100        LayerMask = layerMask;
 4101        ExcludedCollider = excludedCollider;
 4102        IncludeTriggers = includeTriggers;
 4103    }
 104
 105    /// <summary>
 106    /// Creates a mixed 2D circle-slab sweep against all 3D physics layers.
 107    /// </summary>
 108    public PhysicsSweepCircleAgainst3DRequest(
 109        Vector2d start,
 110        Vector2d end,
 111        Fixed64 radius,
 112        Fixed64 slabCenterY,
 113        Fixed64 halfThickness)
 1114        : this(start, end, radius, slabCenterY, halfThickness, PhysicsLayerMask.All)
 115    {
 1116    }
 117
 118    /// <summary>
 119    /// Gets the circle center's start in the X/Z plane.
 120    /// </summary>
 121    public Vector2d Start { get; }
 122
 123    /// <summary>
 124    /// Gets the circle center's end in the X/Z plane.
 125    /// </summary>
 126    public Vector2d End { get; }
 127
 128    /// <summary>
 129    /// Gets the swept circle radius.
 130    /// </summary>
 131    public Fixed64 Radius { get; }
 132
 133    /// <summary>
 134    /// Gets the world-space Y coordinate at the center of the embedded slab.
 135    /// </summary>
 136    public Fixed64 SlabCenterY { get; }
 137
 138    /// <summary>
 139    /// Gets the slab half-thickness along the Y axis.
 140    /// </summary>
 141    public Fixed64 HalfThickness { get; }
 142
 143    /// <summary>
 144    /// Gets the included 3D target layers.
 145    /// </summary>
 146    public PhysicsLayerMask LayerMask { get; }
 147
 148    /// <summary>
 149    /// Gets the optional 2D source collider used for mixed-collision filtering.
 150    /// </summary>
 151    public LSCollider2D? ExcludedCollider { get; }
 152
 153    /// <summary>
 154    /// Gets whether trigger targets are included.
 155    /// </summary>
 156    public bool IncludeTriggers { get; }
 157}