| | | 1 | | //======================================================================= |
| | | 2 | | // PhysicsOverlapCircleInDirection3DRequest.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 | | |
| | | 8 | | using FixedMathSharp; |
| | | 9 | | using Gravitas.Support; |
| | | 10 | | |
| | | 11 | | namespace Gravitas.Queries; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Describes one directional 3D X/Z projected-circle overlap in a batched query call. |
| | | 15 | | /// </summary> |
| | | 16 | | public readonly struct PhysicsOverlapCircleInDirection3DRequest |
| | | 17 | | { |
| | | 18 | | /// <summary> |
| | | 19 | | /// Creates a directional X/Z projected-circle overlap request with an include layer mask. |
| | | 20 | | /// </summary> |
| | | 21 | | public PhysicsOverlapCircleInDirection3DRequest( |
| | | 22 | | Vector3d position, |
| | | 23 | | Fixed64 radius, |
| | | 24 | | Vector3d direction, |
| | | 25 | | Fixed64 maxDistance, |
| | | 26 | | PhysicsLayerMask layerMask) |
| | | 27 | | { |
| | 7 | 28 | | Position = position; |
| | 7 | 29 | | Radius = radius; |
| | 7 | 30 | | Direction = direction; |
| | 7 | 31 | | MaxDistance = maxDistance; |
| | 7 | 32 | | LayerMask = layerMask; |
| | 7 | 33 | | } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Creates a directional X/Z projected-circle overlap request against all physics layers. |
| | | 37 | | /// </summary> |
| | | 38 | | public PhysicsOverlapCircleInDirection3DRequest( |
| | | 39 | | Vector3d position, |
| | | 40 | | Fixed64 radius, |
| | | 41 | | Vector3d direction, |
| | | 42 | | Fixed64 maxDistance) |
| | 1 | 43 | | : this(position, radius, direction, maxDistance, PhysicsLayerMask.All) |
| | | 44 | | { |
| | 1 | 45 | | } |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// Gets the circle center; only its X/Z components are used. |
| | | 49 | | /// </summary> |
| | | 50 | | public Vector3d Position { get; } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Gets the projected circle radius. |
| | | 54 | | /// </summary> |
| | | 55 | | public Fixed64 Radius { get; } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Gets the direction used to filter exact projected separations. |
| | | 59 | | /// </summary> |
| | | 60 | | public Vector3d Direction { get; } |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// Gets the maximum admitted projected separation distance. |
| | | 64 | | /// </summary> |
| | | 65 | | public Fixed64 MaxDistance { get; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Gets the included physics layers. |
| | | 69 | | /// </summary> |
| | | 70 | | public PhysicsLayerMask LayerMask { get; } |
| | | 71 | | } |