com.wallstop-studios.unity-helpers 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/.github/workflows/format-on-demand.yml +2 -2
  2. package/.github/workflows/markdown-json.yml +1 -1
  3. package/.github/workflows/npm-publish.yml +1 -1
  4. package/.github/workflows/prettier-autofix.yml +4 -4
  5. package/.github/workflows/yaml-format-lint.yml +1 -1
  6. package/Docs/EFFECTS_SYSTEM.md +1316 -0
  7. package/{EFFECTS_SYSTEM_TUTORIAL.md → Docs/EFFECTS_SYSTEM_TUTORIAL.md} +1 -1
  8. package/{GETTING_STARTED.md → Docs/GETTING_STARTED.md} +10 -8
  9. package/{GLOSSARY.md → Docs/GLOSSARY.md} +4 -4
  10. package/Docs/HELPER_UTILITIES.md +885 -0
  11. package/Docs/HELPER_UTILITIES.md.meta +7 -0
  12. package/{INDEX.md → Docs/INDEX.md} +107 -62
  13. package/Docs/MATH_AND_EXTENSIONS.md +1039 -0
  14. package/{RANDOM_PERFORMANCE.md → Docs/RANDOM_PERFORMANCE.md} +15 -15
  15. package/{RELATIONAL_COMPONENTS.md → Docs/RELATIONAL_COMPONENTS.md} +21 -3
  16. package/{SPATIAL_TREES_2D_GUIDE.md → Docs/SPATIAL_TREES_2D_GUIDE.md} +2 -2
  17. package/{SPATIAL_TREES_3D_GUIDE.md → Docs/SPATIAL_TREES_3D_GUIDE.md} +1 -1
  18. package/{SPATIAL_TREE_2D_PERFORMANCE.md → Docs/SPATIAL_TREE_2D_PERFORMANCE.md} +64 -64
  19. package/{SPATIAL_TREE_3D_PERFORMANCE.md → Docs/SPATIAL_TREE_3D_PERFORMANCE.md} +64 -64
  20. package/Docs/UTILITY_COMPONENTS.md +906 -0
  21. package/Docs/UTILITY_COMPONENTS.md.meta +7 -0
  22. package/Docs/VISUAL_COMPONENTS.md +337 -0
  23. package/Docs/VISUAL_COMPONENTS.md.meta +7 -0
  24. package/Editor/Sprites/AnimationCopier.cs +3 -3
  25. package/README.md +69 -62
  26. package/Runtime/AssemblyInfo.cs +2 -0
  27. package/Runtime/Core/DataStructure/KDTree3D.cs +1 -1
  28. package/Runtime/Core/DataStructure/OctTree3D.cs +1 -1
  29. package/Runtime/Core/Extension/AsyncOperationExtensions.cs +122 -0
  30. package/Runtime/Core/Helper/Logging/UnityLogTagFormatter.cs +76 -90
  31. package/Runtime/Core/Serialization/ProtobufUnitySurrogates.cs +24 -29
  32. package/Runtime/Integrations/Reflex/AssemblyInfo.cs +7 -0
  33. package/Runtime/Integrations/Reflex/AssemblyInfo.cs.meta +11 -0
  34. package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs +198 -0
  35. package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs.meta +11 -0
  36. package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs +86 -0
  37. package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs.meta +11 -0
  38. package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs +316 -0
  39. package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs.meta +11 -0
  40. package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs +86 -0
  41. package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs.meta +11 -0
  42. package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef +20 -0
  43. package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef.meta +7 -0
  44. package/Runtime/Integrations/Reflex.meta +8 -0
  45. package/Runtime/Utils/ScriptableObjectSingleton.cs +1 -1
  46. package/Samples~/DI - Reflex/README.md +527 -0
  47. package/Samples~/DI - Reflex/README.md.meta +7 -0
  48. package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs +36 -0
  49. package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs.meta +11 -0
  50. package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs +79 -0
  51. package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs.meta +11 -0
  52. package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs +30 -0
  53. package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs.meta +11 -0
  54. package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs +79 -0
  55. package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs.meta +11 -0
  56. package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef +26 -0
  57. package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef.meta +9 -0
  58. package/Samples~/DI - Reflex/Scripts.meta +8 -0
  59. package/Samples~/DI - Reflex.meta +8 -0
  60. package/Samples~/DI - VContainer/README.md +6 -5
  61. package/Samples~/DI - Zenject/README.md +6 -5
  62. package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs +29 -31
  63. package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs +41 -0
  64. package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs.meta +11 -0
  65. package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef +27 -0
  66. package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef.meta +7 -0
  67. package/Tests/Editor/Integrations/Reflex.meta +8 -0
  68. package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs +15 -16
  69. package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs +7 -13
  70. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs +7 -11
  71. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs +19 -21
  72. package/Tests/Editor/PersistentDirectorySettingsTests.cs +0 -1
  73. package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs +0 -1
  74. package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs +2 -2
  75. package/Tests/Editor/Tools/ImageBlurToolTests.cs +1 -1
  76. package/Tests/Editor/Utils/CommonTestBase.cs +17 -0
  77. package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs +1 -1
  78. package/Tests/Runtime/Extensions/AsyncOperationExtensionsTests.cs +179 -0
  79. package/Tests/Runtime/Extensions/RandomExtensionTests.cs +55 -0
  80. package/Tests/Runtime/Extensions/UnityLogTagFormatterEdgeTests.cs +84 -0
  81. package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs +445 -0
  82. package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs.meta +11 -0
  83. package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef +28 -0
  84. package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef.meta +7 -0
  85. package/Tests/Runtime/Integrations/Reflex.meta +8 -0
  86. package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs +24 -29
  87. package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs +8 -3
  88. package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs +10 -20
  89. package/Tests/Runtime/Performance/RandomPerformanceTests.cs +1 -1
  90. package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs +1 -1
  91. package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs +1 -1
  92. package/Tests/Runtime/Serialization/JsonRoundtripComprehensiveTests.cs +4 -9
  93. package/Tests/Runtime/Serialization/ProtoRoundtripComprehensiveTests.cs +13 -13
  94. package/Tests/Runtime/TestUtils/CommonTestBase.cs +11 -0
  95. package/Tests/Runtime/TestUtils/ReflexTestSupport.cs +111 -0
  96. package/Tests/Runtime/TestUtils/ReflexTestSupport.cs.meta +12 -0
  97. package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs +4 -4
  98. package/Tests/TestUtils.meta +8 -0
  99. package/package.json +6 -1
  100. package/EFFECTS_SYSTEM.md +0 -242
  101. package/MATH_AND_EXTENSIONS.md +0 -316
  102. /package/{CHANGELOG.md → Docs/CHANGELOG.md} +0 -0
  103. /package/{CHANGELOG.md.meta → Docs/CHANGELOG.md.meta} +0 -0
  104. /package/{CONTRIBUTING.md → Docs/CONTRIBUTING.md} +0 -0
  105. /package/{CONTRIBUTING.md.meta → Docs/CONTRIBUTING.md.meta} +0 -0
  106. /package/{DATA_STRUCTURES.md → Docs/DATA_STRUCTURES.md} +0 -0
  107. /package/{DATA_STRUCTURES.md.meta → Docs/DATA_STRUCTURES.md.meta} +0 -0
  108. /package/{EDITOR_TOOLS_GUIDE.md → Docs/EDITOR_TOOLS_GUIDE.md} +0 -0
  109. /package/{EDITOR_TOOLS_GUIDE.md.meta → Docs/EDITOR_TOOLS_GUIDE.md.meta} +0 -0
  110. /package/{EFFECTS_SYSTEM.md.meta → Docs/EFFECTS_SYSTEM.md.meta} +0 -0
  111. /package/{EFFECTS_SYSTEM_TUTORIAL.md.meta → Docs/EFFECTS_SYSTEM_TUTORIAL.md.meta} +0 -0
  112. /package/{GETTING_STARTED.md.meta → Docs/GETTING_STARTED.md.meta} +0 -0
  113. /package/{GLOSSARY.md.meta → Docs/GLOSSARY.md.meta} +0 -0
  114. /package/{HULLS.md → Docs/HULLS.md} +0 -0
  115. /package/{HULLS.md.meta → Docs/HULLS.md.meta} +0 -0
  116. /package/{INDEX.md.meta → Docs/INDEX.md.meta} +0 -0
  117. /package/{LICENSE.md → Docs/LICENSE.md} +0 -0
  118. /package/{LICENSE.md.meta → Docs/LICENSE.md.meta} +0 -0
  119. /package/{MATH_AND_EXTENSIONS.md.meta → Docs/MATH_AND_EXTENSIONS.md.meta} +0 -0
  120. /package/{RANDOM_PERFORMANCE.md.meta → Docs/RANDOM_PERFORMANCE.md.meta} +0 -0
  121. /package/{REFLECTION_HELPERS.md → Docs/REFLECTION_HELPERS.md} +0 -0
  122. /package/{REFLECTION_HELPERS.md.meta → Docs/REFLECTION_HELPERS.md.meta} +0 -0
  123. /package/{RELATIONAL_COMPONENTS.md.meta → Docs/RELATIONAL_COMPONENTS.md.meta} +0 -0
  124. /package/{SERIALIZATION.md → Docs/SERIALIZATION.md} +0 -0
  125. /package/{SERIALIZATION.md.meta → Docs/SERIALIZATION.md.meta} +0 -0
  126. /package/{SINGLETONS.md → Docs/SINGLETONS.md} +0 -0
  127. /package/{SINGLETONS.md.meta → Docs/SINGLETONS.md.meta} +0 -0
  128. /package/{SPATIAL_TREES_2D_GUIDE.md.meta → Docs/SPATIAL_TREES_2D_GUIDE.md.meta} +0 -0
  129. /package/{SPATIAL_TREES_3D_GUIDE.md.meta → Docs/SPATIAL_TREES_3D_GUIDE.md.meta} +0 -0
  130. /package/{SPATIAL_TREE_2D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_2D_PERFORMANCE.md.meta} +0 -0
  131. /package/{SPATIAL_TREE_3D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_3D_PERFORMANCE.md.meta} +0 -0
  132. /package/{SPATIAL_TREE_SEMANTICS.md → Docs/SPATIAL_TREE_SEMANTICS.md} +0 -0
  133. /package/{SPATIAL_TREE_SEMANTICS.md.meta → Docs/SPATIAL_TREE_SEMANTICS.md.meta} +0 -0
  134. /package/{THIRD_PARTY_NOTICES.md → Docs/THIRD_PARTY_NOTICES.md} +0 -0
  135. /package/{THIRD_PARTY_NOTICES.md.meta → Docs/THIRD_PARTY_NOTICES.md.meta} +0 -0
@@ -81,18 +81,18 @@ This document contains performance benchmarks for the various random number gene
81
81
 
82
82
  | Random | NextBool | Next | NextUInt | NextFloat | NextDouble | NextUint - Range | NextInt - Range |
83
83
  | --------------------------- | ----------- | ----------- | ------------- | ----------- | ----------- | ---------------- | --------------- |
84
- | DotNetRandom | 534,500,000 | 55,300,000 | 57,600,000 | 46,500,000 | 27,400,000 | 53,700,000 | 53,500,000 |
85
- | LinearCongruentialGenerator | 801,300,000 | 876,500,000 | 1,307,000,000 | 188,400,000 | 376,000,000 | 584,200,000 | 501,200,000 |
86
- | IllusionFlow | 778,600,000 | 631,500,000 | 880,200,000 | 183,400,000 | 324,000,000 | 438,700,000 | 389,100,000 |
87
- | PcgRandom | 785,600,000 | 653,100,000 | 909,700,000 | 188,800,000 | 312,600,000 | 450,700,000 | 406,500,000 |
88
- | RomuDuo | 778,000,000 | 588,000,000 | 754,900,000 | 170,200,000 | 251,600,000 | 439,200,000 | 391,900,000 |
89
- | SplitMix64 | 780,500,000 | 750,100,000 | 1,058,400,000 | 191,300,000 | 358,800,000 | 485,500,000 | 441,300,000 |
90
- | SquirrelRandom | 758,000,000 | 408,100,000 | 413,800,000 | 178,200,000 | 188,100,000 | 367,900,000 | 339,500,000 |
91
- | SystemRandom | 148,000,000 | 148,900,000 | 64,500,000 | 132,000,000 | 139,200,000 | 59,000,000 | 59,000,000 |
92
- | UnityRandom | 657,400,000 | 85,100,000 | 87,800,000 | 63,000,000 | 41,500,000 | 81,100,000 | 82,100,000 |
93
- | WyRandom | 759,500,000 | 383,800,000 | 454,200,000 | 171,600,000 | 189,000,000 | 295,600,000 | 280,100,000 |
94
- | XorShiftRandom | 788,000,000 | 592,100,000 | 603,600,000 | 190,900,000 | 262,100,000 | 479,000,000 | 420,900,000 |
95
- | XoroShiroRandom | 780,600,000 | 557,000,000 | 754,300,000 | 172,800,000 | 251,700,000 | 421,300,000 | 376,300,000 |
84
+ | DotNetRandom | 550,600,000 | 53,100,000 | 57,400,000 | 45,600,000 | 26,900,000 | 53,700,000 | 53,900,000 |
85
+ | LinearCongruentialGenerator | 814,800,000 | 538,900,000 | 1,335,100,000 | 184,700,000 | 296,500,000 | 591,500,000 | 508,400,000 |
86
+ | IllusionFlow | 800,200,000 | 489,500,000 | 892,600,000 | 167,600,000 | 268,200,000 | 444,600,000 | 396,100,000 |
87
+ | PcgRandom | 796,400,000 | 537,900,000 | 889,500,000 | 184,300,000 | 291,400,000 | 456,500,000 | 412,000,000 |
88
+ | RomuDuo | 794,300,000 | 359,300,000 | 766,200,000 | 167,200,000 | 191,600,000 | 446,000,000 | 397,600,000 |
89
+ | SplitMix64 | 801,100,000 | 537,400,000 | 972,300,000 | 183,800,000 | 296,600,000 | 487,500,000 | 446,600,000 |
90
+ | SquirrelRandom | 747,700,000 | 383,300,000 | 413,800,000 | 172,300,000 | 204,800,000 | 330,200,000 | 314,200,000 |
91
+ | SystemRandom | 146,800,000 | 148,300,000 | 65,700,000 | 132,500,000 | 139,500,000 | 59,800,000 | 61,300,000 |
92
+ | UnityRandom | 647,700,000 | 77,800,000 | 87,800,000 | 62,100,000 | 39,500,000 | 81,500,000 | 82,400,000 |
93
+ | WyRandom | 750,700,000 | 382,900,000 | 447,500,000 | 166,800,000 | 191,700,000 | 296,800,000 | 281,100,000 |
94
+ | XorShiftRandom | 792,900,000 | 536,400,000 | 606,000,000 | 184,100,000 | 287,300,000 | 442,800,000 | 391,200,000 |
95
+ | XoroShiroRandom | 789,200,000 | 359,300,000 | 715,100,000 | 167,300,000 | 192,500,000 | 428,900,000 | 383,500,000 |
96
96
 
97
97
  <!-- RANDOM_BENCHMARKS_END -->
98
98
 
@@ -124,13 +124,13 @@ All benchmarks are run for 1 second per operation type to ensure statistical sig
124
124
  **Core Guides:**
125
125
 
126
126
  - [Getting Started](GETTING_STARTED.md) - Your first 5 minutes with Unity Helpers
127
- - [Main README](README.md) - Complete feature overview
127
+ - [Main README](../README.md) - Complete feature overview
128
128
  - [Feature Index](INDEX.md) - Alphabetical reference
129
129
 
130
130
  **Random Number Generator Features:**
131
131
 
132
- - [README - Random Generators](README.md#random-number-generators) - Full API reference
133
- - [README - Quick Start](README.md#random-number-generation) - 60-second tutorial
132
+ - [README - Random Generators](../README.md#random-number-generators) - Full API reference
133
+ - [README - Quick Start](../README.md#random-number-generation) - 60-second tutorial
134
134
 
135
135
  **Related Features:**
136
136
 
@@ -314,7 +314,7 @@ Notes:
314
314
 
315
315
  ## Dependency Injection Integrations
316
316
 
317
- **Stop choosing between DI and clean hierarchy references** - Unity Helpers provides seamless integrations with Zenject and VContainer that automatically wire up your relational component fields right after dependency injection completes.
317
+ **Stop choosing between DI and clean hierarchy references** - Unity Helpers provides seamless integrations with Zenject/Extenject, VContainer, and Reflex that automatically wire up your relational component fields right after dependency injection completes.
318
318
 
319
319
  ### The DI Pain Point
320
320
 
@@ -365,17 +365,19 @@ Unity Helpers automatically detects these packages via UPM:
365
365
 
366
366
  - **Zenject/Extenject**: `com.extenject.zenject`, `com.modesttree.zenject`, `com.svermeulen.extenject`
367
367
  - **VContainer**: `jp.cysharp.vcontainer`, `jp.hadashikick.vcontainer`
368
+ - **Reflex**: `com.gustavopsantos.reflex`
368
369
 
369
370
  > 💡 **UPM packages work out-of-the-box** - No scripting defines needed!
370
371
 
371
372
  ### Manual or Source Imports (Non-UPM)
372
373
 
373
- If you import Zenject/VContainer as source code, .unitypackage, or raw DLLs (not via UPM), you need to manually add scripting defines:
374
+ If you import Zenject/VContainer/Reflex as source code, .unitypackage, or raw DLLs (not via UPM), you need to manually add scripting defines:
374
375
 
375
376
  1. Open `Project Settings > Player > Other Settings > Scripting Define Symbols`
376
377
  2. Add the appropriate define(s) for your target platforms:
377
378
  - `ZENJECT_PRESENT` - When using Zenject/Extenject
378
379
  - `VCONTAINER_PRESENT` - When using VContainer
380
+ - `REFLEX_PRESENT` - When using Reflex
379
381
  3. Unity will recompile and the integration assemblies under `Runtime/Integrations/*` will activate automatically
380
382
 
381
383
  ### VContainer at a Glance
@@ -411,6 +413,22 @@ If you import Zenject/VContainer as source code, .unitypackage, or raw DLLs (not
411
413
 
412
414
  - **Full walkthrough**: [DI – Zenject sample](Samples~/DI%20-%20Zenject/README.md)
413
415
 
416
+ ### Reflex at a Glance
417
+
418
+ - **Install once per scene**
419
+ - Reflex creates a `SceneScope` in each scene. Add `RelationalComponentsInstaller` to the same GameObject (or a child) to bind the relational assigner, run the initial scene scan, and optionally register the additive-scene listener.
420
+ - Toggles mirror the runtime helpers: include inactive objects, choose scan strategy, and enable additive listening.
421
+
422
+ - **Runtime helpers**
423
+ - `_container.InjectWithRelations(existingComponent)` to inject DI fields and hydrate relational attributes on existing objects.
424
+ - `_container.InstantiateComponentWithRelations(componentPrefab, parent)` for component prefabs.
425
+ - `_container.InstantiateGameObjectWithRelations(rootPrefab, parent, includeInactiveChildren: true)` for full hierarchies.
426
+ - `_container.AssignRelationalHierarchy(existingRoot, includeInactiveChildren: true)` to hydrate arbitrary hierarchies after manual instantiation.
427
+
428
+ - **Full walkthrough**: [DI – Reflex sample](Samples~/DI%20-%20Reflex/README.md)
429
+
430
+ - Reflex shares the same fallback behaviour: if the assigner is not bound, the helpers call `AssignRelationalComponents()` directly so you can adopt incrementally.
431
+
414
432
  Notes
415
433
 
416
434
  - Both integrations fall back to the built-in `component.AssignRelationalComponents()` call path if the DI container does not expose the assigner binding, so you can adopt them incrementally without breaking existing behaviour.
@@ -535,7 +553,7 @@ Common pitfalls and how to avoid them
535
553
  **Core Guides:**
536
554
 
537
555
  - [Getting Started](GETTING_STARTED.md) - Your first 5 minutes with Unity Helpers
538
- - [Main README](README.md) - Complete feature overview
556
+ - [Main README](../README.md) - Complete feature overview
539
557
  - [Feature Index](INDEX.md) - Alphabetical reference
540
558
 
541
559
  **Related Features:**
@@ -177,7 +177,7 @@ void Update()
177
177
  }
178
178
  ```
179
179
 
180
- See [Buffering Pattern](README.md#buffering-pattern) for the complete guide and [Pooling Utilities](README.md#pooling-utilities) for more pooling options.
180
+ See [Buffering Pattern](../README.md#buffering-pattern) for the complete guide and [Pooling Utilities](../README.md#pooling-utilities) for more pooling options.
181
181
 
182
182
  ## Structures
183
183
 
@@ -247,7 +247,7 @@ START: Do your objects move frequently?
247
247
  - **Nearest neighbors on static points:** KDTree2D (Balanced)
248
248
  - **Fast builds with good-enough queries:** KDTree2D (Unbalanced)
249
249
  - **Objects with area; bounds queries primary:** RTree2D
250
- - **Very frequent movement (every frame):** SpatialHash2D (see [README](README.md#choosing-spatial-structures))
250
+ - **Very frequent movement (every frame):** SpatialHash2D (see [README](../README.md#choosing-spatial-structures))
251
251
 
252
252
  ## Query Semantics
253
253
 
@@ -167,7 +167,7 @@ void Update()
167
167
  }
168
168
  ```
169
169
 
170
- See [Buffering Pattern](README.md#buffering-pattern) for the complete guide and [Pooling Utilities](README.md#pooling-utilities) for more pooling options.
170
+ See [Buffering Pattern](../README.md#buffering-pattern) for the complete guide and [Pooling Utilities](../README.md#pooling-utilities) for more pooling options.
171
171
 
172
172
  ## Structures
173
173
 
@@ -32,34 +32,34 @@ This document contains performance benchmarks for the 2D spatial tree implementa
32
32
 
33
33
  | Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
34
34
  | ----------------- | ------------------- | --------------------- | ---------- | ---------- |
35
- | 1,000,000 entries | 4 (0.242s) | 6 (0.153s) | 4 (0.221s) | 2 (0.383s) |
35
+ | 1,000,000 entries | 3 (0.325s) | 4 (0.218s) | 4 (0.221s) | 1 (0.595s) |
36
36
 
37
37
  ##### Elements In Range
38
38
 
39
39
  | Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
40
40
  | --------------------------- | ------------------- | --------------------- | ---------- | ------- |
41
- | Full (~span/2) (r=499.5) | 59 | 58 | 56 | 7 |
42
- | Half (~span/4) (r=249.8) | 237 | 238 | 208 | 28 |
43
- | Quarter (~span/8) (r=124.9) | 946 | 946 | 815 | 119 |
44
- | Tiny (~span/1000) (r=1) | 103,296 | 105,692 | 143,494 | 97,759 |
41
+ | Full (~span/2) (r=499.5) | 58 | 58 | 56 | 7 |
42
+ | Half (~span/4) (r=249.8) | 236 | 238 | 215 | 28 |
43
+ | Quarter (~span/8) (r=124.9) | 945 | 946 | 815 | 119 |
44
+ | Tiny (~span/1000) (r=1) | 103,233 | 105,580 | 142,838 | 107,126 |
45
45
 
46
46
  ##### Get Elements In Bounds
47
47
 
48
48
  | Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
49
49
  | -------------------------- | ------------------- | --------------------- | ---------- | ------- |
50
- | Full (size=999.0x999.0) | 317 | 353 | 336 | 17 |
51
- | Half (size=499.5x499.5) | 1,857 | 1,849 | 1,219 | 72 |
52
- | Quarter (size=249.8x249.8) | 7,448 | 7,335 | 3,828 | 377 |
53
- | Unit (size=1) | 148,705 | 152,996 | 197,558 | 112,830 |
50
+ | Full (size=999.0x999.0) | 314 | 325 | 344 | 17 |
51
+ | Half (size=499.5x499.5) | 1,730 | 1,822 | 1,238 | 73 |
52
+ | Quarter (size=249.8x249.8) | 7,188 | 7,170 | 3,867 | 379 |
53
+ | Unit (size=1) | 149,753 | 153,363 | 197,026 | 113,010 |
54
54
 
55
55
  ##### Approximate Nearest Neighbors
56
56
 
57
57
  | Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
58
58
  | ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
59
- | 500 neighbors | 8,468 | 16,899 | 12,711 | 70,133 |
60
- | 100 neighbors | 73,055 | 75,462 | 79,088 | 177,523 |
61
- | 10 neighbors | 402,113 | 359,757 | 236,395 | 283,695 |
62
- | 1 neighbor | 517,286 | 507,752 | 293,106 | 297,633 |
59
+ | 500 neighbors | 8,466 | 16,873 | 12,696 | 70,046 |
60
+ | 100 neighbors | 78,952 | 76,476 | 78,720 | 171,372 |
61
+ | 10 neighbors | 375,484 | 377,708 | 251,988 | 277,491 |
62
+ | 1 neighbor | 551,002 | 508,239 | 276,379 | 299,010 |
63
63
 
64
64
  #### **100,000 entries**
65
65
 
@@ -67,34 +67,34 @@ This document contains performance benchmarks for the 2D spatial tree implementa
67
67
 
68
68
  | Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
69
69
  | --------------- | ------------------- | --------------------- | ----------- | ----------- |
70
- | 100,000 entries | 51 (0.020s) | 84 (0.012s) | 50 (0.020s) | 49 (0.020s) |
70
+ | 100,000 entries | 50 (0.020s) | 83 (0.012s) | 50 (0.020s) | 49 (0.020s) |
71
71
 
72
72
  ##### Elements In Range
73
73
 
74
74
  | Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
75
75
  | --------------------------- | ------------------- | --------------------- | ---------- | ------- |
76
- | Full (~span/2) (r=199.5) | 601 | 601 | 601 | 74 |
77
- | Half (~span/4) (r=99.75) | 1,356 | 1,360 | 1,247 | 185 |
78
- | Quarter (~span/8) (r=49.88) | 4,672 | 5,180 | 4,307 | 722 |
79
- | Tiny (~span/1000) (r=1) | 127,754 | 128,131 | 179,416 | 145,140 |
76
+ | Full (~span/2) (r=199.5) | 602 | 602 | 600 | 73 |
77
+ | Half (~span/4) (r=99.75) | 1,355 | 1,359 | 1,248 | 185 |
78
+ | Quarter (~span/8) (r=49.88) | 4,672 | 5,178 | 4,300 | 723 |
79
+ | Tiny (~span/1000) (r=1) | 127,810 | 128,060 | 179,544 | 145,029 |
80
80
 
81
81
  ##### Get Elements In Bounds
82
82
 
83
83
  | Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
84
84
  | -------------------------- | ------------------- | --------------------- | ---------- | ------- |
85
- | Full (size=399.0x249.0) | 4,645 | 4,645 | 4,706 | 234 |
86
- | Half (size=199.5x124.5) | 9,623 | 12,109 | 7,961 | 965 |
87
- | Quarter (size=99.75x62.25) | 25,400 | 34,298 | 19,544 | 3,784 |
88
- | Unit (size=1) | 184,037 | 185,160 | 245,914 | 155,355 |
85
+ | Full (size=399.0x249.0) | 4,436 | 4,468 | 4,702 | 235 |
86
+ | Half (size=199.5x124.5) | 9,433 | 11,669 | 7,996 | 967 |
87
+ | Quarter (size=99.75x62.25) | 25,419 | 32,186 | 19,754 | 3,805 |
88
+ | Unit (size=1) | 184,712 | 185,636 | 245,390 | 155,220 |
89
89
 
90
90
  ##### Approximate Nearest Neighbors
91
91
 
92
92
  | Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
93
93
  | ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
94
- | 500 neighbors | 9,952 | 9,920 | 11,686 | 70,056 |
95
- | 100 neighbors | 49,710 | 92,455 | 55,495 | 229,190 |
96
- | 10 neighbors | 471,032 | 388,654 | 281,101 | 333,022 |
97
- | 1 neighbor | 480,991 | 549,542 | 338,876 | 373,297 |
94
+ | 500 neighbors | 9,986 | 9,929 | 11,705 | 69,966 |
95
+ | 100 neighbors | 49,779 | 87,233 | 55,229 | 233,211 |
96
+ | 10 neighbors | 470,175 | 394,286 | 294,299 | 352,517 |
97
+ | 1 neighbor | 509,623 | 544,160 | 314,046 | 350,724 |
98
98
 
99
99
  #### **10,000 entries**
100
100
 
@@ -102,34 +102,34 @@ This document contains performance benchmarks for the 2D spatial tree implementa
102
102
 
103
103
  | Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
104
104
  | -------------- | ------------------- | --------------------- | ------------ | ------------ |
105
- | 10,000 entries | 551 (0.002s) | 800 (0.001s) | 546 (0.002s) | 525 (0.002s) |
105
+ | 10,000 entries | 533 (0.002s) | 796 (0.001s) | 408 (0.002s) | 507 (0.002s) |
106
106
 
107
107
  ##### Elements In Range
108
108
 
109
109
  | Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
110
110
  | --------------------------- | ------------------- | --------------------- | ---------- | ------- |
111
- | Full (~span/2) (r=49.50) | 5,942 | 5,945 | 5,941 | 733 |
112
- | Half (~span/4) (r=24.75) | 22,304 | 22,191 | 13,873 | 2,920 |
113
- | Quarter (~span/8) (r=12.38) | 44,208 | 51,431 | 38,116 | 12,194 |
114
- | Tiny (~span/1000) (r=1) | 167,413 | 161,761 | 234,097 | 167,770 |
111
+ | Full (~span/2) (r=49.50) | 5,944 | 5,941 | 5,936 | 735 |
112
+ | Half (~span/4) (r=24.75) | 22,272 | 22,233 | 13,861 | 2,919 |
113
+ | Quarter (~span/8) (r=12.38) | 44,278 | 51,526 | 38,041 | 12,217 |
114
+ | Tiny (~span/1000) (r=1) | 167,798 | 162,582 | 223,371 | 168,224 |
115
115
 
116
116
  ##### Get Elements In Bounds
117
117
 
118
118
  | Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
119
119
  | -------------------------- | ------------------- | --------------------- | ---------- | ------- |
120
- | Full (size=99.00x99.00) | 47,031 | 45,293 | 46,157 | 2,404 |
121
- | Half (size=49.50x49.50) | 167,032 | 165,451 | 36,111 | 9,307 |
122
- | Quarter (size=24.75x24.75) | 75,684 | 103,502 | 75,649 | 35,561 |
123
- | Unit (size=1) | 240,255 | 227,585 | 320,229 | 181,472 |
120
+ | Full (size=99.00x99.00) | 45,222 | 44,244 | 47,466 | 2,412 |
121
+ | Half (size=49.50x49.50) | 167,135 | 166,097 | 36,985 | 9,274 |
122
+ | Quarter (size=24.75x24.75) | 76,007 | 104,425 | 74,227 | 35,573 |
123
+ | Unit (size=1) | 242,092 | 234,546 | 320,164 | 181,677 |
124
124
 
125
125
  ##### Approximate Nearest Neighbors
126
126
 
127
127
  | Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
128
128
  | ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
129
- | 500 neighbors | 13,185 | 13,070 | 14,419 | 65,450 |
130
- | 100 neighbors | 62,217 | 57,218 | 96,702 | 230,930 |
131
- | 10 neighbors | 390,709 | 424,507 | 299,714 | 399,779 |
132
- | 1 neighbor | 641,458 | 605,931 | 398,228 | 460,806 |
129
+ | 500 neighbors | 13,178 | 12,888 | 14,441 | 65,299 |
130
+ | 100 neighbors | 62,415 | 57,120 | 96,738 | 235,553 |
131
+ | 10 neighbors | 418,552 | 392,340 | 316,886 | 420,625 |
132
+ | 1 neighbor | 595,519 | 632,000 | 372,667 | 433,485 |
133
133
 
134
134
  #### **1,000 entries**
135
135
 
@@ -137,34 +137,34 @@ This document contains performance benchmarks for the 2D spatial tree implementa
137
137
 
138
138
  | Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
139
139
  | ------------- | ------------------- | --------------------- | -------------- | -------------- |
140
- | 1,000 entries | 5,293 (0.000s) | 7,651 (0.000s) | 4,833 (0.000s) | 4,714 (0.000s) |
140
+ | 1,000 entries | 4,672 (0.000s) | 5,611 (0.000s) | 4,847 (0.000s) | 4,764 (0.000s) |
141
141
 
142
142
  ##### Elements In Range
143
143
 
144
144
  | Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
145
145
  | -------------------------- | ------------------- | --------------------- | ---------- | ------- |
146
- | Full (~span/2) (r=24.50) | 58,149 | 57,896 | 57,459 | 7,394 |
147
- | Half (~span/4) (r=12.25) | 60,405 | 76,413 | 57,031 | 14,679 |
148
- | Quarter (~span/8) (r=6.13) | 95,613 | 108,483 | 95,695 | 37,751 |
149
- | Tiny (~span/1000) (r=1) | 239,168 | 237,044 | 338,176 | 244,401 |
146
+ | Full (~span/2) (r=24.50) | 58,142 | 56,029 | 57,082 | 7,394 |
147
+ | Half (~span/4) (r=12.25) | 60,439 | 76,572 | 57,123 | 14,698 |
148
+ | Quarter (~span/8) (r=6.13) | 95,988 | 108,457 | 95,703 | 37,920 |
149
+ | Tiny (~span/1000) (r=1) | 239,460 | 237,275 | 333,071 | 251,518 |
150
150
 
151
151
  ##### Get Elements In Bounds
152
152
 
153
153
  | Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
154
154
  | ------------------------- | ------------------- | --------------------- | ---------- | ------- |
155
- | Full (size=49.00x19.00) | 499,646 | 499,135 | 540,101 | 23,360 |
156
- | Half (size=24.50x9.5) | 166,957 | 292,171 | 126,505 | 74,879 |
157
- | Quarter (size=12.25x4.75) | 271,449 | 289,235 | 194,116 | 175,956 |
158
- | Unit (size=1) | 341,843 | 338,190 | 460,298 | 281,087 |
155
+ | Full (size=49.00x19.00) | 499,193 | 498,444 | 508,596 | 24,141 |
156
+ | Half (size=24.50x9.5) | 167,532 | 291,283 | 126,274 | 75,139 |
157
+ | Quarter (size=12.25x4.75) | 271,878 | 288,421 | 194,135 | 176,768 |
158
+ | Unit (size=1) | 342,402 | 339,166 | 460,883 | 281,383 |
159
159
 
160
160
  ##### Approximate Nearest Neighbors
161
161
 
162
162
  | Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
163
163
  | ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
164
- | 500 neighbors | 46,443 | 46,967 | 40,228 | 70,534 |
165
- | 100 neighbors | 79,342 | 78,217 | 92,396 | 272,589 |
166
- | 10 neighbors | 497,653 | 573,470 | 405,080 | 532,922 |
167
- | 1 neighbor | 728,027 | 586,007 | 434,731 | 543,105 |
164
+ | 500 neighbors | 46,434 | 47,214 | 40,048 | 70,543 |
165
+ | 100 neighbors | 80,837 | 77,933 | 91,884 | 267,760 |
166
+ | 10 neighbors | 487,252 | 574,172 | 426,710 | 516,096 |
167
+ | 1 neighbor | 754,604 | 618,120 | 404,966 | 594,659 |
168
168
 
169
169
  #### **100 entries**
170
170
 
@@ -172,33 +172,33 @@ This document contains performance benchmarks for the 2D spatial tree implementa
172
172
 
173
173
  | Construction | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
174
174
  | ------------ | ------------------- | --------------------- | --------------- | --------------- |
175
- | 100 entries | 41,666 (0.000s) | 35,714 (0.000s) | 27,700 (0.000s) | 24,096 (0.000s) |
175
+ | 100 entries | 37,174 (0.000s) | 3,938 (0.000s) | 10,384 (0.000s) | 21,978 (0.000s) |
176
176
 
177
177
  ##### Elements In Range
178
178
 
179
179
  | Elements In Range | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
180
180
  | -------------------------- | ------------------- | --------------------- | ---------- | ------- |
181
- | Full (~span/2) (r=4.5) | 496,195 | 494,030 | 509,285 | 72,691 |
182
- | Half (~span/4) (r=2.25) | 421,999 | 423,114 | 257,119 | 236,378 |
183
- | Quarter (~span/8) (r=1.13) | 421,665 | 394,791 | 599,129 | 338,518 |
184
- | Tiny (~span/1000) (r=1) | 421,578 | 398,874 | 599,521 | 338,820 |
181
+ | Full (~span/2) (r=4.5) | 505,197 | 462,582 | 480,895 | 72,679 |
182
+ | Half (~span/4) (r=2.25) | 428,579 | 432,700 | 256,227 | 233,286 |
183
+ | Quarter (~span/8) (r=1.13) | 422,859 | 432,362 | 601,655 | 318,360 |
184
+ | Tiny (~span/1000) (r=1) | 406,482 | 433,055 | 601,161 | 339,515 |
185
185
 
186
186
  ##### Get Elements In Bounds
187
187
 
188
188
  | Get Elements In Bounds | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
189
189
  | ------------------------ | ------------------- | --------------------- | ---------- | ------- |
190
- | Full (size=9x9) | 2,405,297 | 2,015,574 | 2,414,353 | 224,027 |
191
- | Half (size=4.5x4.5) | 548,616 | 559,875 | 365,374 | 368,394 |
192
- | Quarter (size=2.25x2.25) | 541,107 | 599,286 | 786,141 | 375,705 |
193
- | Unit (size=1) | 563,974 | 599,575 | 786,313 | 394,632 |
190
+ | Full (size=9x9) | 2,460,211 | 2,459,261 | 2,542,373 | 223,694 |
191
+ | Half (size=4.5x4.5) | 572,726 | 561,349 | 365,082 | 372,098 |
192
+ | Quarter (size=2.25x2.25) | 594,157 | 580,857 | 738,232 | 396,288 |
193
+ | Unit (size=1) | 593,669 | 576,995 | 787,477 | 395,564 |
194
194
 
195
195
  ##### Approximate Nearest Neighbors
196
196
 
197
197
  | Approximate Nearest Neighbors | KDTree2D (Balanced) | KDTree2D (Unbalanced) | QuadTree2D | RTree2D |
198
198
  | ----------------------------- | ------------------- | --------------------- | ---------- | ------- |
199
- | 100 neighbors (max) | 156,774 | 165,187 | 202,641 | 323,451 |
200
- | 10 neighbors | 618,887 | 495,826 | 609,986 | 720,591 |
201
- | 1 neighbor | 619,752 | 773,756 | 675,868 | 864,801 |
199
+ | 100 neighbors (max) | 166,728 | 165,861 | 199,072 | 303,148 |
200
+ | 10 neighbors | 610,079 | 520,568 | 639,716 | 735,646 |
201
+ | 1 neighbor | 457,409 | 765,967 | 667,953 | 818,651 |
202
202
 
203
203
  <!-- tabs:end -->
204
204
  <!-- SPATIAL_TREE_BENCHMARKS_END -->