| | | 1 | | //======================================================================= |
| | | 2 | | // PhysicsRaycast3DRequest.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 3D segment raycast in a batched query call. |
| | | 15 | | /// </summary> |
| | | 16 | | public readonly struct PhysicsRaycast3DRequest |
| | | 17 | | { |
| | | 18 | | /// <summary> |
| | | 19 | | /// Creates a 3D segment raycast request with an include layer mask. |
| | | 20 | | /// </summary> |
| | | 21 | | public PhysicsRaycast3DRequest(Vector3d start, Vector3d end, PhysicsLayerMask layerMask) |
| | | 22 | | { |
| | 15 | 23 | | Start = start; |
| | 15 | 24 | | End = end; |
| | 15 | 25 | | LayerMask = layerMask; |
| | 15 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Creates a 3D segment raycast request against all physics layers. |
| | | 30 | | /// </summary> |
| | | 31 | | public PhysicsRaycast3DRequest(Vector3d start, Vector3d end) |
| | 1 | 32 | | : this(start, end, PhysicsLayerMask.All) |
| | | 33 | | { |
| | 1 | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Gets the segment start in world space. |
| | | 38 | | /// </summary> |
| | | 39 | | public Vector3d Start { get; } |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Gets the segment end in world space. |
| | | 43 | | /// </summary> |
| | | 44 | | public Vector3d End { get; } |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// Gets the included physics layers. |
| | | 48 | | /// </summary> |
| | | 49 | | public PhysicsLayerMask LayerMask { get; } |
| | | 50 | | } |