| | | 1 | | //======================================================================= |
| | | 2 | | // PhysicsOverlapCone3DRequest.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 cone-volume overlap in a batched query call. |
| | | 15 | | /// </summary> |
| | | 16 | | public readonly struct PhysicsOverlapCone3DRequest |
| | | 17 | | { |
| | | 18 | | /// <summary> |
| | | 19 | | /// Creates an apex-origin 3D cone-volume overlap request with an include layer mask. |
| | | 20 | | /// </summary> |
| | | 21 | | public PhysicsOverlapCone3DRequest( |
| | | 22 | | Vector3d origin, |
| | | 23 | | Vector3d direction, |
| | | 24 | | Fixed64 length, |
| | | 25 | | Fixed64 endRadius, |
| | | 26 | | PhysicsLayerMask layerMask) |
| | | 27 | | { |
| | 15 | 28 | | Origin = origin; |
| | 15 | 29 | | Direction = direction; |
| | 15 | 30 | | Length = length; |
| | 15 | 31 | | EndRadius = endRadius; |
| | 15 | 32 | | LayerMask = layerMask; |
| | 15 | 33 | | } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Creates an apex-origin 3D cone-volume overlap request against all physics layers. |
| | | 37 | | /// </summary> |
| | | 38 | | public PhysicsOverlapCone3DRequest( |
| | | 39 | | Vector3d origin, |
| | | 40 | | Vector3d direction, |
| | | 41 | | Fixed64 length, |
| | | 42 | | Fixed64 endRadius) |
| | 3 | 43 | | : this(origin, direction, length, endRadius, PhysicsLayerMask.All) |
| | | 44 | | { |
| | 3 | 45 | | } |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// Gets the world-space cone apex. |
| | | 49 | | /// </summary> |
| | | 50 | | public Vector3d Origin { get; } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Gets the cone axis direction. |
| | | 54 | | /// </summary> |
| | | 55 | | public Vector3d Direction { get; } |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Gets the cone length from apex to base. |
| | | 59 | | /// </summary> |
| | | 60 | | public Fixed64 Length { get; } |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// Gets the cone radius at its base. |
| | | 64 | | /// </summary> |
| | | 65 | | public Fixed64 EndRadius { get; } |
| | | 66 | | |
| | | 67 | | /// <summary> |
| | | 68 | | /// Gets the included physics layers. |
| | | 69 | | /// </summary> |
| | | 70 | | public PhysicsLayerMask LayerMask { get; } |
| | | 71 | | } |