| | | 1 | | //======================================================================= |
| | | 2 | | // PhysicsOverlapAabb2DRequest.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 pure 2D axis-aligned box overlap in a batched query call. |
| | | 15 | | /// </summary> |
| | | 16 | | public readonly struct PhysicsOverlapAabb2DRequest |
| | | 17 | | { |
| | | 18 | | /// <summary> |
| | | 19 | | /// Creates a pure 2D axis-aligned box-overlap request with an include layer mask. |
| | | 20 | | /// </summary> |
| | | 21 | | public PhysicsOverlapAabb2DRequest(Vector2d center, Vector2d size, PhysicsLayerMask layerMask) |
| | | 22 | | { |
| | 6 | 23 | | Center = center; |
| | 6 | 24 | | Size = size; |
| | 6 | 25 | | LayerMask = layerMask; |
| | 6 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Creates a pure 2D axis-aligned box-overlap request against all physics layers. |
| | | 30 | | /// </summary> |
| | | 31 | | public PhysicsOverlapAabb2DRequest(Vector2d center, Vector2d size) |
| | 1 | 32 | | : this(center, size, PhysicsLayerMask.All) |
| | | 33 | | { |
| | 1 | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Gets the box center in the X/Z plane. |
| | | 38 | | /// </summary> |
| | | 39 | | public Vector2d Center { get; } |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Gets the full box size in the X/Z plane. |
| | | 43 | | /// </summary> |
| | | 44 | | public Vector2d Size { get; } |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// Gets the included physics layers. |
| | | 48 | | /// </summary> |
| | | 49 | | public PhysicsLayerMask LayerMask { get; } |
| | | 50 | | } |