| | | 1 | | //======================================================================= |
| | | 2 | | // GravitasPhysics2DService.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 Gravitas.Colliders; |
| | | 9 | | using Gravitas.CollisionHandling; |
| | | 10 | | using SwiftCollections; |
| | | 11 | | using System.Runtime.CompilerServices; |
| | | 12 | | |
| | | 13 | | namespace Gravitas; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Context-owned pure 2D body, broad-phase, narrow-phase, response, and query service. |
| | | 17 | | /// </summary> |
| | | 18 | | public sealed partial class GravitasPhysics2DService |
| | | 19 | | { |
| | 1 | 20 | | private static readonly CollisionPair2DStableKeyComparer ResponsePairComparer = new(); |
| | 1 | 21 | | private static readonly IslandNodeKeyComparer<DiscreteIslandNode2D> IslandNodeComparer = new(); |
| | 1 | 22 | | private static readonly DiscreteIslandConstraint2DComparer IslandConstraintComparer = new(); |
| | | 23 | | |
| | | 24 | | private readonly GravitasWorldContext _context; |
| | 5083 | 25 | | private readonly SwiftBucket<SolidBody2D> _dynamicBodies = new(); |
| | 5083 | 26 | | private readonly ColliderRegistry<LSCollider2D> _colliders = new(); |
| | 5083 | 27 | | private readonly SwiftList<LSCollider2D> _serviceRefreshColliders = new(); |
| | 5083 | 28 | | private readonly SwiftHashSet<ulong> _processedPairKeys = new(); |
| | 5083 | 29 | | private readonly SwiftDictionary<ulong, CollisionPair2D> _pairs = new(); |
| | 5083 | 30 | | private readonly SwiftList<ulong> _pairsToRemove = new(); |
| | 5083 | 31 | | private readonly SwiftList<CollisionPair2D> _pairsPendingSeparation = new(); |
| | 5083 | 32 | | private readonly SwiftStack<CollisionPair2D> _cachedPairs = new(); |
| | 5083 | 33 | | private readonly SwiftList<CollisionPair2D> _discreteResponsePairs = new(); |
| | 5083 | 34 | | private readonly SwiftList<CollisionPair2D> _existingResponsePairCandidates = new(); |
| | 5083 | 35 | | private readonly SwiftHashSet<int> _discreteResponseBodyKeys = new(); |
| | 5083 | 36 | | private readonly SwiftList<int> _discreteResponseBodyQueue = new(); |
| | 5083 | 37 | | private readonly SwiftList<DiscreteIslandNode2D> _discreteIslandNodes = new(); |
| | 5083 | 38 | | private readonly SwiftList<DiscreteIslandConstraint2D> _discreteIslandConstraints = new(); |
| | 5083 | 39 | | private readonly DynamicCcdCandidateIndex2D _planarContinuousCollisionCandidates = new(); |
| | 5083 | 40 | | private readonly DynamicCcdCandidateIndex2D _dirtyPlanarContinuousCollisionCandidates = |
| | 5083 | 41 | | new(supportsUpdates: true); |
| | 5083 | 42 | | private readonly SwiftList<SolidBody2D> _dirtyPlanarContinuousCollisionBodies = new(); |
| | 5083 | 43 | | private readonly SwiftHashSet<SolidBody2D> _dirtyPlanarContinuousCollisionBodySet = new(); |
| | 5083 | 44 | | private readonly DynamicCcdCandidateIndex _mixedContinuousCollisionCandidates = new(); |
| | 5083 | 45 | | private readonly DynamicCcdCandidateIndex _dirtyMixedContinuousCollisionCandidates = |
| | 5083 | 46 | | new(supportsUpdates: true); |
| | 5083 | 47 | | private readonly SwiftList<ColliderLifetimeToken2D> _continuousCollisionCandidateLifetimes = new(); |
| | 5083 | 48 | | private readonly SwiftList<int> _continuousCollisionCandidateIds = new(); |
| | 5083 | 49 | | private readonly SwiftList<int> _dirtyContinuousCollisionCandidateIds = new(); |
| | 5083 | 50 | | private readonly SwiftHashSet<SolidBody2D> _processedContinuousCollisionBodies = new(); |
| | 5083 | 51 | | private readonly SwiftHashSet<SolidBody2D> _queuedContinuousCollisionHandoffBodies = new(); |
| | 5083 | 52 | | private readonly SwiftList<SolidBody2D> _continuousCollisionHandoffQueue = new(); |
| | 5083 | 53 | | private int _continuousCollisionPreparedToken = int.MinValue; |
| | | 54 | | private bool _continuousCollisionPreparedMixedIndex; |
| | | 55 | | |
| | | 56 | | /// <summary>Creates the pure 2D physics service for a world context.</summary> |
| | 5083 | 57 | | public GravitasPhysics2DService(GravitasWorldContext context) |
| | | 58 | | { |
| | 5083 | 59 | | SwiftThrowHelper.ThrowIfNull(context, nameof(context)); |
| | 5083 | 60 | | _context = context; |
| | 5083 | 61 | | } |
| | | 62 | | |
| | | 63 | | /// <summary>Gets the number of registered dynamic bodies.</summary> |
| | | 64 | | public int BodyCount { get; private set; } |
| | | 65 | | |
| | | 66 | | /// <summary>Gets the number of registered 2D colliders.</summary> |
| | 10409 | 67 | | public int ColliderCount => _colliders.Count; |
| | | 68 | | |
| | | 69 | | /// <summary>Gets or sets whether this service advances pure 2D physics.</summary> |
| | | 70 | | public bool SimulatePhysics { get; set; } = true; |
| | | 71 | | |
| | | 72 | | internal int LastBroadPhaseCandidateCount { get; private set; } |
| | | 73 | | |
| | | 74 | | /// <summary> |
| | | 75 | | /// Gets how many service-owned continuous-collision handoff batches were consumed during the last late step. |
| | | 76 | | /// </summary> |
| | | 77 | | public int LastContinuousCollisionIslandCount { get; private set; } |
| | | 78 | | |
| | | 79 | | /// <summary> |
| | | 80 | | /// Gets how many service-owned continuous-collision handoff iterations were consumed during the last late step. |
| | | 81 | | /// </summary> |
| | | 82 | | public int LastContinuousCollisionIslandIterationCount { get; private set; } |
| | | 83 | | |
| | | 84 | | /// <summary> |
| | | 85 | | /// Gets whether the service-owned continuous-collision handoff queue hit its deterministic iteration cap. |
| | | 86 | | /// </summary> |
| | | 87 | | public bool LastContinuousCollisionIslandLimitReached { get; private set; } |
| | | 88 | | |
| | | 89 | | internal void AssimilateBody(SolidBody2D body, BodyMotionType motionType) |
| | | 90 | | { |
| | 4652 | 91 | | SwiftThrowHelper.ThrowIfNull(body, nameof(body)); |
| | 4652 | 92 | | SwiftThrowHelper.ThrowIfArgument( |
| | 4652 | 93 | | !ReferenceEquals(body.Context, _context), |
| | 4652 | 94 | | nameof(body), |
| | 4652 | 95 | | "2D body must belong to this physics service context."); |
| | | 96 | | |
| | 4652 | 97 | | if (motionType != BodyMotionType.Static) |
| | | 98 | | { |
| | 3292 | 99 | | body.DynamicId = _dynamicBodies.Add(body); |
| | 6560 | 100 | | while (_continuousCollisionCandidateLifetimes.Count <= body.DynamicId) |
| | 3268 | 101 | | _continuousCollisionCandidateLifetimes.Add(default); |
| | 3292 | 102 | | BodyCount++; |
| | | 103 | | } |
| | | 104 | | |
| | 4652 | 105 | | AssimilateCollider(body.Collider); |
| | 4652 | 106 | | } |
| | | 107 | | |
| | | 108 | | internal void RefreshBodyMotionTypeRegistration( |
| | | 109 | | SolidBody2D body, |
| | | 110 | | BodyMotionType previousMotionType) |
| | | 111 | | { |
| | 78 | 112 | | if (previousMotionType == BodyMotionType.Static) |
| | | 113 | | { |
| | 13 | 114 | | body.DynamicId = _dynamicBodies.Add(body); |
| | 20 | 115 | | while (_continuousCollisionCandidateLifetimes.Count <= body.DynamicId) |
| | 7 | 116 | | _continuousCollisionCandidateLifetimes.Add(default); |
| | 13 | 117 | | BodyCount++; |
| | 13 | 118 | | return; |
| | | 119 | | } |
| | | 120 | | |
| | 65 | 121 | | if (body.MotionType == BodyMotionType.Static) |
| | | 122 | | { |
| | 14 | 123 | | int previousDynamicId = body.DynamicId; |
| | 14 | 124 | | _dynamicBodies.RemoveAt(previousDynamicId); |
| | 14 | 125 | | _continuousCollisionCandidateLifetimes[previousDynamicId] = default; |
| | 14 | 126 | | ReleaseContinuousCollisionCandidateRefresh(body); |
| | 14 | 127 | | body.DynamicId = -1; |
| | 14 | 128 | | BodyCount--; |
| | | 129 | | } |
| | 65 | 130 | | } |
| | | 131 | | |
| | | 132 | | internal void AssimilateCollider(LSCollider2D collider) |
| | | 133 | | { |
| | 5162 | 134 | | SwiftThrowHelper.ThrowIfNull(collider, nameof(collider)); |
| | 5162 | 135 | | SwiftThrowHelper.ThrowIfArgument( |
| | 5162 | 136 | | !ReferenceEquals(collider.Context, _context), |
| | 5162 | 137 | | nameof(collider), |
| | 5162 | 138 | | "2D collider must belong to this physics service context."); |
| | | 139 | | |
| | 5162 | 140 | | _colliders.Register(collider); |
| | 5162 | 141 | | RefreshColliderServiceRefreshRegistration(collider); |
| | 5162 | 142 | | _context.Collisions2D.PartitionCollider(collider); |
| | 5162 | 143 | | } |
| | | 144 | | |
| | | 145 | | internal void DessimilateBody(SolidBody2D body) |
| | | 146 | | { |
| | 123 | 147 | | SwiftThrowHelper.ThrowIfNull(body, nameof(body)); |
| | 123 | 148 | | if (body.DynamicId >= 0 && _dynamicBodies.TryRemoveAt(body.DynamicId)) |
| | | 149 | | { |
| | 105 | 150 | | _continuousCollisionCandidateLifetimes[body.DynamicId] = default; |
| | 105 | 151 | | ReleaseContinuousCollisionCandidateRefresh(body); |
| | 105 | 152 | | BodyCount--; |
| | | 153 | | } |
| | | 154 | | |
| | 123 | 155 | | LSCollider2D collider = body.Collider; |
| | 123 | 156 | | DessimilateCollider(collider); |
| | 123 | 157 | | } |
| | | 158 | | |
| | | 159 | | internal void DessimilateCollider(LSCollider2D collider) |
| | | 160 | | { |
| | 264 | 161 | | SwiftThrowHelper.ThrowIfNull(collider, nameof(collider)); |
| | 264 | 162 | | if (collider.Body != null) |
| | 123 | 163 | | _context.Constraints2D.RemoveJointsForBody(collider.Body); |
| | 264 | 164 | | RemovePairsForCollider(collider); |
| | 264 | 165 | | _context.MixedCollisions.RemovePairsFor2DCollider(collider); |
| | 264 | 166 | | if (collider.IsMixedPartitioned) |
| | 18 | 167 | | _context.MixedCollisions.ClearPartitioned2DCollider(collider, force: true); |
| | 264 | 168 | | if (collider.IsPartitioned) |
| | 258 | 169 | | _context.Collisions2D.ClearPartitionedCollider(collider, force: true); |
| | | 170 | | |
| | 264 | 171 | | RemoveServiceRefreshCollider(collider); |
| | 264 | 172 | | _colliders.Remove(collider); |
| | 264 | 173 | | } |
| | | 174 | | |
| | | 175 | | /// <summary>Runs the authoritative pure 2D simulation phase.</summary> |
| | | 176 | | public void Simulate() |
| | | 177 | | { |
| | 480 | 178 | | _context.EnterSimulationPhase(); |
| | | 179 | | try |
| | | 180 | | { |
| | 480 | 181 | | if (!SimulatePhysics) |
| | 5 | 182 | | return; |
| | | 183 | | |
| | 475 | 184 | | LastBroadPhaseCandidateCount = 0; |
| | 475 | 185 | | } |
| | | 186 | | finally |
| | | 187 | | { |
| | 480 | 188 | | _context.ExitSimulationPhase(); |
| | 480 | 189 | | } |
| | 480 | 190 | | } |
| | | 191 | | |
| | | 192 | | /// <summary>Completes deferred pure 2D collision, response, and bookkeeping work.</summary> |
| | | 193 | | public void LateSimulate() |
| | | 194 | | { |
| | 4 | 195 | | _context.EnterSimulationPhase(); |
| | | 196 | | try |
| | | 197 | | { |
| | 4 | 198 | | if (!BeginLateSimulateBodies(continuousCollisionFramePrepared: false)) |
| | 1 | 199 | | return; |
| | | 200 | | |
| | 3 | 201 | | ProcessQueuedContinuousCollisionHandoffs(); |
| | 3 | 202 | | CompleteLateSimulatePhysicsStep(); |
| | 3 | 203 | | } |
| | | 204 | | finally |
| | | 205 | | { |
| | 4 | 206 | | _context.ExitSimulationPhase(); |
| | 4 | 207 | | } |
| | 4 | 208 | | } |
| | | 209 | | |
| | | 210 | | internal bool BeginLateSimulateBodies(bool continuousCollisionFramePrepared) |
| | | 211 | | { |
| | 1022 | 212 | | if (!SimulatePhysics) |
| | 1 | 213 | | return false; |
| | | 214 | | |
| | 1021 | 215 | | if (!continuousCollisionFramePrepared) |
| | 17 | 216 | | _context.AdvanceLateSimulateToken(); |
| | | 217 | | |
| | 1021 | 218 | | PrepareContinuousCollisionFrame(); |
| | 1021 | 219 | | BeginContinuousCollisionHandoffFrame(); |
| | | 220 | | |
| | 6645 | 221 | | foreach (SolidBody2D body in _dynamicBodies) |
| | | 222 | | { |
| | 2302 | 223 | | body.LateSimulate(updateSleepState: false, updateColliderState: false); |
| | 2301 | 224 | | _processedContinuousCollisionBodies.Add(body); |
| | | 225 | | } |
| | | 226 | | |
| | 1020 | 227 | | return true; |
| | | 228 | | } |
| | | 229 | | |
| | | 230 | | internal void CompleteLateSimulatePhysicsStep() |
| | | 231 | | { |
| | 1003 | 232 | | PrepareCollisionPartitions(); |
| | 1003 | 233 | | RunDiscreteCollisionStep(); |
| | 1003 | 234 | | UpdateSleepStatesAfterPhysicsStep(); |
| | 1003 | 235 | | } |
| | | 236 | | |
| | | 237 | | private void PrepareCollisionPartitions() |
| | | 238 | | { |
| | 6548 | 239 | | foreach (SolidBody2D body in _dynamicBodies) |
| | 2271 | 240 | | body.Collider.Simulate(); |
| | | 241 | | |
| | 4128 | 242 | | for (int i = 0; i < _serviceRefreshColliders.Count; i++) |
| | 1061 | 243 | | _serviceRefreshColliders[i].Simulate(); |
| | 1003 | 244 | | } |
| | | 245 | | |
| | | 246 | | private void RunDiscreteCollisionStep() |
| | | 247 | | { |
| | 1003 | 248 | | LastBroadPhaseCandidateCount = 0; |
| | 1003 | 249 | | EnsureFrameCapacity(); |
| | 1003 | 250 | | _processedPairKeys.Clear(); |
| | 1003 | 251 | | _discreteResponsePairs.FastClear(); |
| | 1003 | 252 | | int frame = _context.FrameCount; |
| | 1003 | 253 | | _context.Collisions2D.CheckAndDistributeCollisions(); |
| | 1003 | 254 | | ExpandDiscreteResponsePairs(frame); |
| | 1003 | 255 | | SolveDiscreteResponsePairs(); |
| | 1003 | 256 | | RefreshGroundingFromDiscreteResponse(frame); |
| | 1003 | 257 | | CleanupUntouchedPairs(frame); |
| | 1003 | 258 | | _context.Collisions2D.RetireExpiredRetainedPartitions(); |
| | 1003 | 259 | | } |
| | | 260 | | |
| | | 261 | | private void UpdateSleepStatesAfterPhysicsStep() |
| | | 262 | | { |
| | 6542 | 263 | | foreach (SolidBody2D body in _dynamicBodies) |
| | 2268 | 264 | | body.UpdateSleepStateAfterPhysicsStep(); |
| | 1003 | 265 | | } |
| | | 266 | | |
| | | 267 | | /// <summary>Publishes interpolated presentation state for registered 2D bodies.</summary> |
| | | 268 | | public void Visualize() |
| | | 269 | | { |
| | 26 | 270 | | foreach (SolidBody2D body in _dynamicBodies) |
| | 6 | 271 | | body.OnVisualize(); |
| | 7 | 272 | | } |
| | | 273 | | |
| | | 274 | | /// <summary>Clears all context-local pure 2D registration and solver state.</summary> |
| | | 275 | | public void Reset() |
| | | 276 | | { |
| | 33 | 277 | | DiscardContinuousCollisionHandoffQueue(); |
| | 33 | 278 | | _dynamicBodies.Clear(); |
| | 33 | 279 | | _colliders.Clear(); |
| | 33 | 280 | | _serviceRefreshColliders.FastClear(); |
| | 33 | 281 | | _processedPairKeys.Clear(); |
| | 33 | 282 | | _pairs.Clear(); |
| | 33 | 283 | | _pairsToRemove.FastClear(); |
| | 33 | 284 | | _pairsPendingSeparation.FastClear(); |
| | 33 | 285 | | _cachedPairs.Clear(); |
| | 33 | 286 | | _discreteResponsePairs.FastClear(); |
| | 33 | 287 | | _existingResponsePairCandidates.FastClear(); |
| | 33 | 288 | | _discreteResponseBodyKeys.Clear(); |
| | 33 | 289 | | _discreteResponseBodyQueue.FastClear(); |
| | 33 | 290 | | _discreteIslandNodes.FastClear(); |
| | 33 | 291 | | _discreteIslandConstraints.FastClear(); |
| | 33 | 292 | | _planarContinuousCollisionCandidates.Clear(); |
| | 33 | 293 | | _dirtyPlanarContinuousCollisionCandidates.Clear(); |
| | 33 | 294 | | _dirtyPlanarContinuousCollisionBodies.FastClear(); |
| | 33 | 295 | | _dirtyPlanarContinuousCollisionBodySet.Clear(); |
| | 33 | 296 | | _mixedContinuousCollisionCandidates.Clear(); |
| | 33 | 297 | | _dirtyMixedContinuousCollisionCandidates.Clear(); |
| | 33 | 298 | | _continuousCollisionCandidateLifetimes.Clear(); |
| | 33 | 299 | | _continuousCollisionCandidateIds.FastClear(); |
| | 33 | 300 | | _dirtyContinuousCollisionCandidateIds.FastClear(); |
| | 33 | 301 | | _processedContinuousCollisionBodies.Clear(); |
| | 33 | 302 | | _continuousCollisionPreparedToken = int.MinValue; |
| | 33 | 303 | | _continuousCollisionPreparedMixedIndex = false; |
| | 33 | 304 | | BodyCount = 0; |
| | 33 | 305 | | LastBroadPhaseCandidateCount = 0; |
| | 33 | 306 | | LastContinuousCollisionIslandCount = 0; |
| | 33 | 307 | | LastContinuousCollisionIslandIterationCount = 0; |
| | 33 | 308 | | LastContinuousCollisionIslandLimitReached = false; |
| | 33 | 309 | | } |
| | | 310 | | |
| | | 311 | | internal bool TryGetColliderById(int colliderId, out LSCollider2D? collider) => |
| | 421050 | 312 | | _colliders.TryGetById(colliderId, out collider); |
| | | 313 | | |
| | | 314 | | internal bool TryGetColliderByServiceIndex(int serviceIndex, out LSCollider2D? collider) => |
| | 2 | 315 | | _colliders.TryGetByServiceIndex(serviceIndex, out collider); |
| | | 316 | | |
| | 1219 | 317 | | internal LSCollider2D GetColliderByServiceIndex(int serviceIndex) => _colliders[serviceIndex]; |
| | | 318 | | |
| | 1124 | 319 | | internal SwiftList<LSCollider2D> PrepareReplayColliders() => _colliders.PrepareReplayColliders(); |
| | | 320 | | |
| | | 321 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | | 322 | | internal bool TryGetDynamicBody(int dynamicId, out SolidBody2D body) => |
| | 473 | 323 | | _dynamicBodies.TryGetValue(dynamicId, out body); |
| | | 324 | | |
| | | 325 | | internal void RefreshColliderServiceRefreshRegistration(LSCollider2D collider) |
| | | 326 | | { |
| | 5240 | 327 | | SwiftThrowHelper.ThrowIfNull(collider, nameof(collider)); |
| | | 328 | | |
| | 5240 | 329 | | if (collider.RequiresServiceSideRefresh) |
| | 1884 | 330 | | AddServiceRefreshCollider(collider); |
| | | 331 | | else |
| | 3356 | 332 | | RemoveServiceRefreshCollider(collider); |
| | 3356 | 333 | | } |
| | | 334 | | |
| | | 335 | | private void AddServiceRefreshCollider(LSCollider2D collider) |
| | | 336 | | { |
| | 1884 | 337 | | collider.SetServiceRefreshIndex(_serviceRefreshColliders.Count); |
| | 1884 | 338 | | _serviceRefreshColliders.Add(collider); |
| | 1884 | 339 | | } |
| | | 340 | | |
| | | 341 | | private void RemoveServiceRefreshCollider(LSCollider2D collider) |
| | | 342 | | { |
| | 3620 | 343 | | int index = collider.ServiceRefreshIndex; |
| | 3620 | 344 | | if (index < 0 || !ReferenceEquals(_serviceRefreshColliders[index], collider)) |
| | | 345 | | { |
| | 3449 | 346 | | collider.ClearServiceRefreshIndex(); |
| | 3449 | 347 | | return; |
| | | 348 | | } |
| | | 349 | | |
| | 171 | 350 | | int lastIndex = _serviceRefreshColliders.Count - 1; |
| | 171 | 351 | | if (index != lastIndex) |
| | | 352 | | { |
| | 12 | 353 | | LSCollider2D moved = _serviceRefreshColliders[lastIndex]; |
| | 12 | 354 | | _serviceRefreshColliders[index] = moved; |
| | 12 | 355 | | moved.SetServiceRefreshIndex(index); |
| | | 356 | | } |
| | | 357 | | |
| | 171 | 358 | | _serviceRefreshColliders.RemoveAt(lastIndex); |
| | 171 | 359 | | collider.ClearServiceRefreshIndex(); |
| | 171 | 360 | | } |
| | | 361 | | |
| | | 362 | | private void EnsureFrameCapacity() |
| | | 363 | | { |
| | 1003 | 364 | | int colliderCount = _colliders.Count; |
| | 1003 | 365 | | if (colliderCount <= 0) |
| | 16 | 366 | | return; |
| | | 367 | | |
| | 987 | 368 | | int expectedPairKeyCapacity = System.Math.Max(colliderCount * 4, _pairs.Count); |
| | 987 | 369 | | _processedPairKeys.EnsureCapacity(expectedPairKeyCapacity); |
| | 987 | 370 | | _pairsToRemove.EnsureCapacity(expectedPairKeyCapacity); |
| | 987 | 371 | | _pairsPendingSeparation.EnsureCapacity(expectedPairKeyCapacity); |
| | 987 | 372 | | _discreteResponsePairs.EnsureCapacity(expectedPairKeyCapacity); |
| | 987 | 373 | | _existingResponsePairCandidates.EnsureCapacity(expectedPairKeyCapacity); |
| | 987 | 374 | | _discreteResponseBodyKeys.EnsureCapacity(colliderCount); |
| | 987 | 375 | | _discreteResponseBodyQueue.EnsureCapacity(colliderCount); |
| | 987 | 376 | | _discreteIslandNodes.EnsureCapacity(colliderCount); |
| | 987 | 377 | | _discreteIslandConstraints.EnsureCapacity(expectedPairKeyCapacity); |
| | 987 | 378 | | if (_context.Settings.PoolingEnabled) |
| | 981 | 379 | | _cachedPairs.EnsureCapacity(colliderCount); |
| | 987 | 380 | | } |
| | | 381 | | |
| | | 382 | | } |