| | | 1 | | using FixedMathSharp; |
| | | 2 | | using GridForge.Grids; |
| | | 3 | | using SwiftCollections; |
| | | 4 | | |
| | | 5 | | namespace Trailblazer.Pathing; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Routes external-grid bridge diagnostics and event-signature tracking through the active pathing context. |
| | | 9 | | /// </summary> |
| | | 10 | | internal static class PathManagerExternalGridBridge |
| | | 11 | | { |
| | | 12 | | private static SwiftDictionary<ushort, ExternalGridEventObservation> _eventObservationsByGridIndex => |
| | 5680 | 13 | | PathManager.ActiveState.ExternalGridEventObservationsByGridIndex; |
| | | 14 | | |
| | | 15 | | private static SwiftDictionary<ushort, PendingExternalGridChange> _pendingGridChangesByGridIndex => |
| | 7095 | 16 | | PathManager.ActiveState.PendingGridChangesByGridIndex; |
| | | 17 | | |
| | | 18 | | private static SwiftList<ushort> _pendingGridChangeOrder => |
| | 8984 | 19 | | PathManager.ActiveState.PendingGridChangeOrder; |
| | | 20 | | |
| | | 21 | | private static int _gridEventsReceived |
| | | 22 | | { |
| | 2035 | 23 | | get => PathManager.ActiveState.GridEventsReceived; |
| | 3661 | 24 | | set => PathManager.ActiveState.GridEventsReceived = value; |
| | | 25 | | } |
| | | 26 | | |
| | | 27 | | private static int _gridAddEventsReceived |
| | | 28 | | { |
| | 743 | 29 | | get => PathManager.ActiveState.GridAddEventsReceived; |
| | 2369 | 30 | | set => PathManager.ActiveState.GridAddEventsReceived = value; |
| | | 31 | | } |
| | | 32 | | |
| | | 33 | | private static int _gridRemoveEventsReceived |
| | | 34 | | { |
| | 25 | 35 | | get => PathManager.ActiveState.GridRemoveEventsReceived; |
| | 1651 | 36 | | set => PathManager.ActiveState.GridRemoveEventsReceived = value; |
| | | 37 | | } |
| | | 38 | | |
| | | 39 | | private static int _gridChangeEventsReceived |
| | | 40 | | { |
| | 1299 | 41 | | get => PathManager.ActiveState.GridChangeEventsReceived; |
| | 2925 | 42 | | set => PathManager.ActiveState.GridChangeEventsReceived = value; |
| | | 43 | | } |
| | | 44 | | |
| | | 45 | | private static int _distinctObservedGridSlots |
| | | 46 | | { |
| | 745 | 47 | | get => PathManager.ActiveState.DistinctObservedGridSlots; |
| | 2371 | 48 | | set => PathManager.ActiveState.DistinctObservedGridSlots = value; |
| | | 49 | | } |
| | | 50 | | |
| | | 51 | | private static int _duplicateGridEventSignaturesObserved |
| | | 52 | | { |
| | 19 | 53 | | get => PathManager.ActiveState.DuplicateGridEventSignaturesObserved; |
| | 1645 | 54 | | set => PathManager.ActiveState.DuplicateGridEventSignaturesObserved = value; |
| | | 55 | | } |
| | | 56 | | |
| | | 57 | | private static int _duplicateGridAddEventSignaturesObserved |
| | | 58 | | { |
| | 17 | 59 | | get => PathManager.ActiveState.DuplicateGridAddEventSignaturesObserved; |
| | 1643 | 60 | | set => PathManager.ActiveState.DuplicateGridAddEventSignaturesObserved = value; |
| | | 61 | | } |
| | | 62 | | |
| | | 63 | | private static int _duplicateGridRemoveEventSignaturesObserved |
| | | 64 | | { |
| | 17 | 65 | | get => PathManager.ActiveState.DuplicateGridRemoveEventSignaturesObserved; |
| | 1643 | 66 | | set => PathManager.ActiveState.DuplicateGridRemoveEventSignaturesObserved = value; |
| | | 67 | | } |
| | | 68 | | |
| | | 69 | | private static int _duplicateGridChangeEventSignaturesObserved |
| | | 70 | | { |
| | 17 | 71 | | get => PathManager.ActiveState.DuplicateGridChangeEventSignaturesObserved; |
| | 1643 | 72 | | set => PathManager.ActiveState.DuplicateGridChangeEventSignaturesObserved = value; |
| | | 73 | | } |
| | | 74 | | |
| | | 75 | | private static int _maxGridEventStreak |
| | | 76 | | { |
| | 2035 | 77 | | get => PathManager.ActiveState.MaxGridEventStreak; |
| | 2360 | 78 | | set => PathManager.ActiveState.MaxGridEventStreak = value; |
| | | 79 | | } |
| | | 80 | | |
| | | 81 | | private static int _gridRebuildPassesExecuted |
| | | 82 | | { |
| | 38 | 83 | | get => PathManager.ActiveState.GridRebuildPassesExecuted; |
| | 1664 | 84 | | set => PathManager.ActiveState.GridRebuildPassesExecuted = value; |
| | | 85 | | } |
| | | 86 | | |
| | | 87 | | private static int _gridEventsIgnoredForNoIntersectingCharts |
| | | 88 | | { |
| | 460 | 89 | | get => PathManager.ActiveState.GridEventsIgnoredForNoIntersectingCharts; |
| | 2086 | 90 | | set => PathManager.ActiveState.GridEventsIgnoredForNoIntersectingCharts = value; |
| | | 91 | | } |
| | | 92 | | |
| | | 93 | | private static int _totalChartsSelectedForGridRebuild |
| | | 94 | | { |
| | 38 | 95 | | get => PathManager.ActiveState.TotalChartsSelectedForGridRebuild; |
| | 1664 | 96 | | set => PathManager.ActiveState.TotalChartsSelectedForGridRebuild = value; |
| | | 97 | | } |
| | | 98 | | |
| | | 99 | | private static int _maxChartsSelectedForSingleGridEvent |
| | | 100 | | { |
| | 38 | 101 | | get => PathManager.ActiveState.MaxChartsSelectedForSingleGridEvent; |
| | 1661 | 102 | | set => PathManager.ActiveState.MaxChartsSelectedForSingleGridEvent = value; |
| | | 103 | | } |
| | | 104 | | |
| | | 105 | | internal static ExternalGridBridgeDiagnosticsSnapshot GetDiagnosticsSnapshot() |
| | | 106 | | { |
| | 16 | 107 | | return new ExternalGridBridgeDiagnosticsSnapshot( |
| | 16 | 108 | | totalGridEventsReceived: _gridEventsReceived, |
| | 16 | 109 | | addedEventsReceived: _gridAddEventsReceived, |
| | 16 | 110 | | removedEventsReceived: _gridRemoveEventsReceived, |
| | 16 | 111 | | changedEventsReceived: _gridChangeEventsReceived, |
| | 16 | 112 | | distinctGridSlotsObserved: _distinctObservedGridSlots, |
| | 16 | 113 | | duplicateEventSignaturesObserved: _duplicateGridEventSignaturesObserved, |
| | 16 | 114 | | duplicateAddEventSignaturesObserved: _duplicateGridAddEventSignaturesObserved, |
| | 16 | 115 | | duplicateRemoveEventSignaturesObserved: _duplicateGridRemoveEventSignaturesObserved, |
| | 16 | 116 | | duplicateChangeEventSignaturesObserved: _duplicateGridChangeEventSignaturesObserved, |
| | 16 | 117 | | maxIdenticalEventStreak: _maxGridEventStreak, |
| | 16 | 118 | | rebuildPassesExecuted: _gridRebuildPassesExecuted, |
| | 16 | 119 | | eventsIgnoredForNoIntersectingCharts: _gridEventsIgnoredForNoIntersectingCharts, |
| | 16 | 120 | | totalChartsSelectedForRebuild: _totalChartsSelectedForGridRebuild, |
| | 16 | 121 | | maxChartsSelectedForSingleEvent: _maxChartsSelectedForSingleGridEvent); |
| | | 122 | | } |
| | | 123 | | |
| | | 124 | | internal static void ResetDiagnostics() |
| | | 125 | | { |
| | 1642 | 126 | | _eventObservationsByGridIndex.Clear(); |
| | 1642 | 127 | | _pendingGridChangesByGridIndex.Clear(); |
| | 1642 | 128 | | _pendingGridChangeOrder.Clear(); |
| | 1642 | 129 | | _gridEventsReceived = 0; |
| | 1642 | 130 | | _gridAddEventsReceived = 0; |
| | 1642 | 131 | | _gridRemoveEventsReceived = 0; |
| | 1642 | 132 | | _gridChangeEventsReceived = 0; |
| | 1642 | 133 | | _distinctObservedGridSlots = 0; |
| | 1642 | 134 | | _duplicateGridEventSignaturesObserved = 0; |
| | 1642 | 135 | | _duplicateGridAddEventSignaturesObserved = 0; |
| | 1642 | 136 | | _duplicateGridRemoveEventSignaturesObserved = 0; |
| | 1642 | 137 | | _duplicateGridChangeEventSignaturesObserved = 0; |
| | 1642 | 138 | | _maxGridEventStreak = 0; |
| | 1642 | 139 | | _gridRebuildPassesExecuted = 0; |
| | 1642 | 140 | | _gridEventsIgnoredForNoIntersectingCharts = 0; |
| | 1642 | 141 | | _totalChartsSelectedForGridRebuild = 0; |
| | 1642 | 142 | | _maxChartsSelectedForSingleGridEvent = 0; |
| | 1642 | 143 | | } |
| | | 144 | | |
| | | 145 | | internal static void HandleGridAdded(GridEventInfo eventInfo) |
| | | 146 | | { |
| | 727 | 147 | | HandleGridChange(eventInfo, ExternalGridEventKind.Added); |
| | 727 | 148 | | } |
| | | 149 | | |
| | | 150 | | internal static void HandleGridRemoved(GridEventInfo eventInfo) |
| | | 151 | | { |
| | 9 | 152 | | HandleGridChange(eventInfo, ExternalGridEventKind.Removed); |
| | 9 | 153 | | } |
| | | 154 | | |
| | | 155 | | internal static void HandleGridChanged(GridEventInfo eventInfo) |
| | | 156 | | { |
| | 1283 | 157 | | HandleGridChange(eventInfo, ExternalGridEventKind.Changed); |
| | 1283 | 158 | | } |
| | | 159 | | |
| | | 160 | | internal static void FlushPendingGridChanges() |
| | | 161 | | { |
| | 3266 | 162 | | if (_pendingGridChangeOrder.Count == 0) |
| | 2799 | 163 | | return; |
| | | 164 | | |
| | 467 | 165 | | int requestCount = 0; |
| | 1890 | 166 | | for (int i = 0; i < _pendingGridChangeOrder.Count; i++) |
| | | 167 | | { |
| | 478 | 168 | | ushort gridIndex = _pendingGridChangeOrder[i]; |
| | 478 | 169 | | if (_pendingGridChangesByGridIndex.TryGetValue(gridIndex, out PendingExternalGridChange pendingChange) |
| | 478 | 170 | | && pendingChange.HasSelectionCriteria) |
| | | 171 | | { |
| | 476 | 172 | | requestCount++; |
| | | 173 | | } |
| | | 174 | | } |
| | | 175 | | |
| | 467 | 176 | | if (requestCount == 0) |
| | | 177 | | { |
| | 1 | 178 | | ClearPendingGridChanges(); |
| | 1 | 179 | | return; |
| | | 180 | | } |
| | | 181 | | |
| | 466 | 182 | | ExternalGridChartRebuildRequest[] rebuildRequests = new ExternalGridChartRebuildRequest[requestCount]; |
| | 466 | 183 | | int requestIndex = 0; |
| | 1884 | 184 | | for (int i = 0; i < _pendingGridChangeOrder.Count; i++) |
| | | 185 | | { |
| | 476 | 186 | | ushort gridIndex = _pendingGridChangeOrder[i]; |
| | 476 | 187 | | if (!_pendingGridChangesByGridIndex.TryGetValue(gridIndex, out PendingExternalGridChange pendingChange) |
| | 476 | 188 | | || !pendingChange.HasSelectionCriteria) |
| | | 189 | | { |
| | | 190 | | continue; |
| | | 191 | | } |
| | | 192 | | |
| | 476 | 193 | | rebuildRequests[requestIndex++] = pendingChange.ToRebuildRequest(gridIndex); |
| | | 194 | | } |
| | | 195 | | |
| | 466 | 196 | | ClearPendingGridChanges(); |
| | 466 | 197 | | RecordGridRebuildSelection(PathManager.RebuildInitializedChartsAgainstExternalGridRequests(rebuildRequests)); |
| | 466 | 198 | | } |
| | | 199 | | |
| | | 200 | | private static void HandleGridReset() |
| | | 201 | | { |
| | 1 | 202 | | PathManager.Reset(); |
| | 1 | 203 | | } |
| | | 204 | | |
| | | 205 | | private static void HandleGridChange(GridEventInfo eventInfo, ExternalGridEventKind eventKind) |
| | | 206 | | { |
| | 2019 | 207 | | if (RecordGridEvent(eventInfo, eventKind)) |
| | 3 | 208 | | return; |
| | | 209 | | |
| | 2016 | 210 | | QueuePendingGridChange(eventInfo, eventKind); |
| | 2016 | 211 | | } |
| | | 212 | | |
| | | 213 | | private static bool RecordGridEvent(GridEventInfo eventInfo, ExternalGridEventKind eventKind) |
| | | 214 | | { |
| | 2019 | 215 | | _gridEventsReceived++; |
| | | 216 | | |
| | | 217 | | switch (eventKind) |
| | | 218 | | { |
| | | 219 | | case ExternalGridEventKind.Added: |
| | 727 | 220 | | _gridAddEventsReceived++; |
| | 727 | 221 | | break; |
| | | 222 | | case ExternalGridEventKind.Removed: |
| | 9 | 223 | | _gridRemoveEventsReceived++; |
| | 9 | 224 | | break; |
| | | 225 | | default: |
| | 1283 | 226 | | _gridChangeEventsReceived++; |
| | | 227 | | break; |
| | | 228 | | } |
| | | 229 | | |
| | 2019 | 230 | | ExternalGridEventSignature signature = new( |
| | 2019 | 231 | | eventKind, |
| | 2019 | 232 | | eventInfo.GridSpawnToken, |
| | 2019 | 233 | | eventInfo.GridVersion, |
| | 2019 | 234 | | eventInfo.Configuration, |
| | 2019 | 235 | | eventInfo.BoundsMin, |
| | 2019 | 236 | | eventInfo.BoundsMax); |
| | | 237 | | |
| | 2019 | 238 | | if (_eventObservationsByGridIndex.TryGetValue(eventInfo.GridIndex, out ExternalGridEventObservation observation) |
| | | 239 | | { |
| | 1290 | 240 | | if (observation.Signature.Equals(signature)) |
| | | 241 | | { |
| | 3 | 242 | | _duplicateGridEventSignaturesObserved++; |
| | | 243 | | switch (eventKind) |
| | | 244 | | { |
| | | 245 | | case ExternalGridEventKind.Added: |
| | 1 | 246 | | _duplicateGridAddEventSignaturesObserved++; |
| | 1 | 247 | | break; |
| | | 248 | | case ExternalGridEventKind.Removed: |
| | 1 | 249 | | _duplicateGridRemoveEventSignaturesObserved++; |
| | 1 | 250 | | break; |
| | | 251 | | default: |
| | 1 | 252 | | _duplicateGridChangeEventSignaturesObserved++; |
| | | 253 | | break; |
| | | 254 | | } |
| | | 255 | | |
| | 3 | 256 | | observation = new ExternalGridEventObservation(signature, observation.IdenticalEventStreak + 1); |
| | 3 | 257 | | _eventObservationsByGridIndex[eventInfo.GridIndex] = observation; |
| | 3 | 258 | | if (observation.IdenticalEventStreak > _maxGridEventStreak) |
| | 3 | 259 | | _maxGridEventStreak = observation.IdenticalEventStreak; |
| | | 260 | | |
| | 3 | 261 | | return true; |
| | | 262 | | } |
| | | 263 | | else |
| | | 264 | | { |
| | 1287 | 265 | | observation = new ExternalGridEventObservation(signature, identicalEventStreak: 1); |
| | | 266 | | } |
| | | 267 | | } |
| | | 268 | | else |
| | | 269 | | { |
| | 729 | 270 | | _distinctObservedGridSlots++; |
| | 729 | 271 | | observation = new ExternalGridEventObservation(signature, identicalEventStreak: 1); |
| | | 272 | | } |
| | | 273 | | |
| | 2016 | 274 | | _eventObservationsByGridIndex[eventInfo.GridIndex] = observation; |
| | 2016 | 275 | | if (observation.IdenticalEventStreak > _maxGridEventStreak) |
| | 715 | 276 | | _maxGridEventStreak = observation.IdenticalEventStreak; |
| | | 277 | | |
| | 2016 | 278 | | return false; |
| | | 279 | | } |
| | | 280 | | |
| | | 281 | | private static void RecordGridRebuildSelection(int chartCount) |
| | | 282 | | { |
| | 466 | 283 | | if (chartCount <= 0) |
| | | 284 | | { |
| | 444 | 285 | | _gridEventsIgnoredForNoIntersectingCharts++; |
| | 444 | 286 | | return; |
| | | 287 | | } |
| | | 288 | | |
| | 22 | 289 | | _gridRebuildPassesExecuted++; |
| | 22 | 290 | | _totalChartsSelectedForGridRebuild += chartCount; |
| | 22 | 291 | | if (chartCount > _maxChartsSelectedForSingleGridEvent) |
| | 19 | 292 | | _maxChartsSelectedForSingleGridEvent = chartCount; |
| | 22 | 293 | | } |
| | | 294 | | |
| | | 295 | | private static void QueuePendingGridChange(GridEventInfo eventInfo, ExternalGridEventKind eventKind) |
| | | 296 | | { |
| | 2016 | 297 | | ushort gridIndex = eventInfo.GridIndex; |
| | 2016 | 298 | | if (_pendingGridChangesByGridIndex.TryGetValue(gridIndex, out PendingExternalGridChange pendingChange)) |
| | | 299 | | { |
| | 1248 | 300 | | _pendingGridChangesByGridIndex[gridIndex] = MergePendingGridChange(pendingChange, eventInfo, eventKind); |
| | 1248 | 301 | | return; |
| | | 302 | | } |
| | | 303 | | |
| | 768 | 304 | | _pendingGridChangesByGridIndex[gridIndex] = CreatePendingGridChange(eventInfo, eventKind); |
| | 768 | 305 | | _pendingGridChangeOrder.Add(gridIndex); |
| | 768 | 306 | | } |
| | | 307 | | |
| | | 308 | | private static PendingExternalGridChange CreatePendingGridChange( |
| | | 309 | | GridEventInfo eventInfo, |
| | | 310 | | ExternalGridEventKind eventKind) |
| | | 311 | | { |
| | 768 | 312 | | return new PendingExternalGridChange( |
| | 768 | 313 | | eventInfo.GridSpawnToken, |
| | 768 | 314 | | eventInfo.GridVersion, |
| | 768 | 315 | | eventInfo.BoundsMin, |
| | 768 | 316 | | eventInfo.BoundsMax, |
| | 768 | 317 | | requiresLiveGridTouchSelection: eventKind != ExternalGridEventKind.Added, |
| | 768 | 318 | | requiresAuthoredCellBoundsSelection: eventKind == ExternalGridEventKind.Added); |
| | | 319 | | } |
| | | 320 | | |
| | | 321 | | private static PendingExternalGridChange MergePendingGridChange( |
| | | 322 | | PendingExternalGridChange pendingChange, |
| | | 323 | | GridEventInfo eventInfo, |
| | | 324 | | ExternalGridEventKind eventKind) |
| | | 325 | | { |
| | 1248 | 326 | | if (pendingChange.GridSpawnToken != eventInfo.GridSpawnToken) |
| | 2 | 327 | | return MergePendingGridChangeAcrossSpawnTokens(pendingChange, eventInfo, eventKind); |
| | | 328 | | |
| | 1246 | 329 | | return MergePendingGridChangeForSameSpawnToken(pendingChange, eventInfo, eventKind); |
| | | 330 | | } |
| | | 331 | | |
| | | 332 | | private static PendingExternalGridChange MergePendingGridChangeAcrossSpawnTokens( |
| | | 333 | | PendingExternalGridChange pendingChange, |
| | | 334 | | GridEventInfo eventInfo, |
| | | 335 | | ExternalGridEventKind eventKind) |
| | | 336 | | { |
| | 2 | 337 | | return new PendingExternalGridChange( |
| | 2 | 338 | | eventInfo.GridSpawnToken, |
| | 2 | 339 | | eventInfo.GridVersion, |
| | 2 | 340 | | eventInfo.BoundsMin, |
| | 2 | 341 | | eventInfo.BoundsMax, |
| | 2 | 342 | | requiresLiveGridTouchSelection: pendingChange.RequiresLiveGridTouchSelection, |
| | 2 | 343 | | requiresAuthoredCellBoundsSelection: eventKind != ExternalGridEventKind.Removed); |
| | | 344 | | } |
| | | 345 | | |
| | | 346 | | private static PendingExternalGridChange MergePendingGridChangeForSameSpawnToken( |
| | | 347 | | PendingExternalGridChange pendingChange, |
| | | 348 | | GridEventInfo eventInfo, |
| | | 349 | | ExternalGridEventKind eventKind) |
| | | 350 | | { |
| | 1248 | 351 | | bool requiresLiveGridTouchSelection = pendingChange.RequiresLiveGridTouchSelection; |
| | 1248 | 352 | | bool requiresAuthoredCellBoundsSelection = pendingChange.RequiresAuthoredCellBoundsSelection; |
| | | 353 | | |
| | | 354 | | switch (eventKind) |
| | | 355 | | { |
| | | 356 | | case ExternalGridEventKind.Added: |
| | 1 | 357 | | requiresAuthoredCellBoundsSelection = true; |
| | 1 | 358 | | break; |
| | | 359 | | |
| | | 360 | | case ExternalGridEventKind.Changed: |
| | 1245 | 361 | | if (!requiresAuthoredCellBoundsSelection) |
| | 1205 | 362 | | requiresLiveGridTouchSelection = true; |
| | | 363 | | |
| | 1205 | 364 | | break; |
| | | 365 | | |
| | | 366 | | case ExternalGridEventKind.Removed: |
| | 2 | 367 | | if (requiresAuthoredCellBoundsSelection && !requiresLiveGridTouchSelection) |
| | 1 | 368 | | requiresAuthoredCellBoundsSelection = false; |
| | | 369 | | else |
| | | 370 | | { |
| | 1 | 371 | | requiresLiveGridTouchSelection = true; |
| | 1 | 372 | | requiresAuthoredCellBoundsSelection = false; |
| | | 373 | | } |
| | | 374 | | |
| | | 375 | | break; |
| | | 376 | | } |
| | | 377 | | |
| | 1248 | 378 | | Vector3d boundsMin = eventInfo.BoundsMin; |
| | 1248 | 379 | | Vector3d boundsMax = eventInfo.BoundsMax; |
| | 1248 | 380 | | if (requiresAuthoredCellBoundsSelection) |
| | | 381 | | { |
| | 41 | 382 | | boundsMin = MinBounds(pendingChange.BoundsMin, eventInfo.BoundsMin); |
| | 41 | 383 | | boundsMax = MaxBounds(pendingChange.BoundsMax, eventInfo.BoundsMax); |
| | | 384 | | } |
| | | 385 | | |
| | 1248 | 386 | | return new PendingExternalGridChange( |
| | 1248 | 387 | | eventInfo.GridSpawnToken, |
| | 1248 | 388 | | eventInfo.GridVersion, |
| | 1248 | 389 | | boundsMin, |
| | 1248 | 390 | | boundsMax, |
| | 1248 | 391 | | requiresLiveGridTouchSelection, |
| | 1248 | 392 | | requiresAuthoredCellBoundsSelection); |
| | | 393 | | } |
| | | 394 | | |
| | | 395 | | private static void ClearPendingGridChanges() |
| | | 396 | | { |
| | 467 | 397 | | _pendingGridChangesByGridIndex.Clear(); |
| | 467 | 398 | | _pendingGridChangeOrder.Clear(); |
| | 467 | 399 | | } |
| | | 400 | | |
| | | 401 | | private static Vector3d MinBounds(Vector3d left, Vector3d right) |
| | | 402 | | { |
| | 41 | 403 | | return new Vector3d( |
| | 41 | 404 | | left.x <= right.x ? left.x : right.x, |
| | 41 | 405 | | left.y <= right.y ? left.y : right.y, |
| | 41 | 406 | | left.z <= right.z ? left.z : right.z); |
| | | 407 | | } |
| | | 408 | | |
| | | 409 | | private static Vector3d MaxBounds(Vector3d left, Vector3d right) |
| | | 410 | | { |
| | 41 | 411 | | return new Vector3d( |
| | 41 | 412 | | left.x >= right.x ? left.x : right.x, |
| | 41 | 413 | | left.y >= right.y ? left.y : right.y, |
| | 41 | 414 | | left.z >= right.z ? left.z : right.z); |
| | | 415 | | } |
| | | 416 | | |
| | | 417 | | } |