| | | 1 | | //======================================================================= |
| | | 2 | | // PhysicsSweepCapsule3DRequest.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.Colliders; |
| | | 10 | | using Gravitas.Support; |
| | | 11 | | |
| | | 12 | | namespace Gravitas.Queries; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Describes one registered 3D capsule-source sweep in a batched query call. |
| | | 16 | | /// </summary> |
| | | 17 | | public readonly struct PhysicsSweepCapsule3DRequest |
| | | 18 | | { |
| | | 19 | | /// <summary> |
| | | 20 | | /// Creates a registered capsule-source sweep request. |
| | | 21 | | /// </summary> |
| | | 22 | | public PhysicsSweepCapsule3DRequest( |
| | | 23 | | LSCapsuleCollider source, |
| | | 24 | | Vector3d displacement, |
| | | 25 | | PhysicsLayerMask layerMask, |
| | | 26 | | LSCollider? excludedCollider = null, |
| | | 27 | | bool includeTriggers = true) |
| | | 28 | | { |
| | 2 | 29 | | Source = source; |
| | 2 | 30 | | Displacement = displacement; |
| | 2 | 31 | | LayerMask = layerMask; |
| | 2 | 32 | | ExcludedCollider = excludedCollider; |
| | 2 | 33 | | IncludeTriggers = includeTriggers; |
| | 2 | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Gets the registered capsule swept from its current transform. |
| | | 38 | | /// </summary> |
| | | 39 | | public LSCapsuleCollider Source { get; } |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Gets the world-space sweep displacement. |
| | | 43 | | /// </summary> |
| | | 44 | | public Vector3d Displacement { get; } |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// Gets the included physics layers. |
| | | 48 | | /// </summary> |
| | | 49 | | public PhysicsLayerMask LayerMask { get; } |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// Gets the collider omitted from candidate results, if any. |
| | | 53 | | /// </summary> |
| | | 54 | | public LSCollider? ExcludedCollider { get; } |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// Gets whether trigger colliders are included. |
| | | 58 | | /// </summary> |
| | | 59 | | public bool IncludeTriggers { get; } |
| | | 60 | | } |