| | | 1 | | //======================================================================= |
| | | 2 | | // GridNavigationBodyTraceCandidate.cs |
| | | 3 | | //======================================================================= |
| | | 4 | | // MIT License, Copyright (c) 2024-present David Oravsky (mrdav30) |
| | | 5 | | // See LICENSE file in the project root for full license information. |
| | | 6 | | //======================================================================= |
| | | 7 | | |
| | | 8 | | using GridForge.Grids.Topology; |
| | | 9 | | using GridForge.Spatial; |
| | | 10 | | |
| | | 11 | | namespace GridForge.Grids; |
| | | 12 | | |
| | | 13 | | internal readonly struct GridNavigationBodyTraceCandidate |
| | | 14 | | { |
| | | 15 | | internal GridNavigationBodyTraceCandidate( |
| | | 16 | | VoxelGrid grid, |
| | | 17 | | VoxelIndex index, |
| | | 18 | | GridCellPrism prism, |
| | | 19 | | bool hasPositiveOverlap, |
| | | 20 | | bool isClosure, |
| | | 21 | | bool isPhysicallyPresent = false, |
| | | 22 | | ulong gridLastChangeSequence = 0UL, |
| | | 23 | | bool isVisited = false) |
| | | 24 | | { |
| | 5100 | 25 | | Grid = grid; |
| | 5100 | 26 | | Index = index; |
| | 5100 | 27 | | Prism = prism; |
| | 5100 | 28 | | HasPositiveOverlap = hasPositiveOverlap; |
| | 5100 | 29 | | IsClosure = isClosure; |
| | 5100 | 30 | | IsPhysicallyPresent = isPhysicallyPresent; |
| | 5100 | 31 | | GridLastChangeSequence = gridLastChangeSequence; |
| | 5100 | 32 | | IsVisited = isVisited; |
| | 5100 | 33 | | } |
| | | 34 | | |
| | | 35 | | internal VoxelGrid Grid { get; } |
| | | 36 | | |
| | | 37 | | internal VoxelIndex Index { get; } |
| | | 38 | | |
| | | 39 | | internal GridCellPrism Prism { get; } |
| | | 40 | | |
| | | 41 | | internal bool HasPositiveOverlap { get; } |
| | | 42 | | |
| | | 43 | | internal bool IsClosure { get; } |
| | | 44 | | |
| | | 45 | | internal bool IsPhysicallyPresent { get; } |
| | | 46 | | |
| | | 47 | | internal ulong GridLastChangeSequence { get; } |
| | | 48 | | |
| | | 49 | | internal bool IsVisited { get; } |
| | | 50 | | |
| | | 51 | | internal GridNavigationBodyTraceCandidate WithPhysicalEvidence( |
| | | 52 | | bool isPhysicallyPresent, |
| | | 53 | | ulong gridLastChangeSequence) => |
| | 1705 | 54 | | new( |
| | 1705 | 55 | | Grid, |
| | 1705 | 56 | | Index, |
| | 1705 | 57 | | Prism, |
| | 1705 | 58 | | HasPositiveOverlap, |
| | 1705 | 59 | | IsClosure, |
| | 1705 | 60 | | isPhysicallyPresent, |
| | 1705 | 61 | | gridLastChangeSequence, |
| | 1705 | 62 | | IsVisited); |
| | | 63 | | |
| | | 64 | | internal GridNavigationBodyTraceCandidate WithVisited() => |
| | 1650 | 65 | | new( |
| | 1650 | 66 | | Grid, |
| | 1650 | 67 | | Index, |
| | 1650 | 68 | | Prism, |
| | 1650 | 69 | | HasPositiveOverlap, |
| | 1650 | 70 | | IsClosure, |
| | 1650 | 71 | | IsPhysicallyPresent, |
| | 1650 | 72 | | GridLastChangeSequence, |
| | 1650 | 73 | | isVisited: true); |
| | | 74 | | } |