com.wallstop-studios.unity-helpers 2.0.0-rc81.9 → 2.0.1

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 (264) hide show
  1. package/.editorconfig +1 -1
  2. package/.gitattributes +1 -1
  3. package/.githooks/pre-commit +31 -5
  4. package/.githooks/pre-push +50 -0
  5. package/.github/dependabot.yml +24 -2
  6. package/.github/scripts/check-markdown-links.ps1 +77 -0
  7. package/.github/scripts/check_markdown_links.py +89 -0
  8. package/.github/scripts/check_markdown_url_encoding.py +74 -0
  9. package/.github/scripts/validate_markdown_links.py +194 -0
  10. package/.github/workflows/csharpier-autofix.yml +152 -0
  11. package/.github/workflows/format-on-demand.yml +305 -0
  12. package/.github/workflows/lint-doc-links.yml +8 -5
  13. package/.github/workflows/markdown-json.yml +6 -2
  14. package/.github/workflows/npm-publish.yml +1 -1
  15. package/.github/workflows/prettier-autofix.yml +195 -0
  16. package/.github/workflows/update-dotnet-tools.yml +80 -0
  17. package/.github/workflows/yaml-format-lint.yml +41 -0
  18. package/.lychee.toml +4 -4
  19. package/.markdownlint.jsonc +21 -0
  20. package/.pre-commit-config.yaml +11 -3
  21. package/.yamllint.yaml +31 -0
  22. package/AGENTS.md +5 -1
  23. package/Docs/CHANGELOG.md +11 -0
  24. package/Docs/CONTRIBUTING.md +49 -0
  25. package/Docs/CONTRIBUTING.md.meta +7 -0
  26. package/{EDITOR_TOOLS_GUIDE.md → Docs/EDITOR_TOOLS_GUIDE.md} +4 -0
  27. package/Docs/EFFECTS_SYSTEM.md +1316 -0
  28. package/{EFFECTS_SYSTEM_TUTORIAL.md → Docs/EFFECTS_SYSTEM_TUTORIAL.md} +1 -1
  29. package/{GETTING_STARTED.md → Docs/GETTING_STARTED.md} +50 -64
  30. package/{GLOSSARY.md → Docs/GLOSSARY.md} +4 -4
  31. package/Docs/HELPER_UTILITIES.md +885 -0
  32. package/Docs/HELPER_UTILITIES.md.meta +7 -0
  33. package/{INDEX.md → Docs/INDEX.md} +107 -62
  34. package/Docs/MATH_AND_EXTENSIONS.md +1039 -0
  35. package/{RANDOM_PERFORMANCE.md → Docs/RANDOM_PERFORMANCE.md} +15 -15
  36. package/{RELATIONAL_COMPONENTS.md → Docs/RELATIONAL_COMPONENTS.md} +111 -84
  37. package/{SERIALIZATION.md → Docs/SERIALIZATION.md} +15 -0
  38. package/{SPATIAL_TREES_2D_GUIDE.md → Docs/SPATIAL_TREES_2D_GUIDE.md} +2 -2
  39. package/{SPATIAL_TREES_3D_GUIDE.md → Docs/SPATIAL_TREES_3D_GUIDE.md} +1 -1
  40. package/Docs/SPATIAL_TREE_2D_PERFORMANCE.md +241 -0
  41. package/Docs/SPATIAL_TREE_3D_PERFORMANCE.md +243 -0
  42. package/{THIRD_PARTY_NOTICES.md → Docs/THIRD_PARTY_NOTICES.md} +1 -1
  43. package/Docs/UTILITY_COMPONENTS.md +906 -0
  44. package/Docs/UTILITY_COMPONENTS.md.meta +7 -0
  45. package/Docs/VISUAL_COMPONENTS.md +337 -0
  46. package/Docs/VISUAL_COMPONENTS.md.meta +7 -0
  47. package/Editor/AnimationEventEditor.cs +337 -160
  48. package/Editor/Core/Helper/AnimationEventHelpers.cs +178 -152
  49. package/Editor/CustomEditors/PersistentDirectoryGUI.cs +20 -11
  50. package/Editor/CustomEditors/TexturePlatformOverrideEntryDrawer.cs +11 -2
  51. package/Editor/FitTextureSizeWindow.cs +43 -19
  52. package/Editor/PersistentDirectorySettings.cs +64 -12
  53. package/Editor/PrefabChecker.cs +72 -5
  54. package/Editor/Sprites/AnimationCopier.cs +131 -55
  55. package/Editor/Sprites/AnimationCreator.cs +63 -22
  56. package/Editor/Sprites/AnimationViewerWindow.cs +42 -6
  57. package/Editor/Sprites/TexturePlatformNameHelper.cs +50 -39
  58. package/Editor/Sprites/TextureResizerWizard.cs +23 -1
  59. package/Editor/Sprites/TextureSettingsApplierWindow.cs +148 -85
  60. package/Editor/Tools/ImageBlurTool.cs +81 -10
  61. package/Editor/Utils/EditorUi.cs +1 -1
  62. package/Editor/Utils/ScriptableObjectSingletonCreator.cs +1 -1
  63. package/README.md +428 -2433
  64. package/Runtime/AssemblyInfo.cs +4 -0
  65. package/Runtime/Core/Attributes/NotNullAttribute.cs +1 -3
  66. package/Runtime/Core/Attributes/RelationalComponentAssigner.cs +50 -5
  67. package/Runtime/Core/DataStructure/CyclicBuffer.cs +0 -1
  68. package/Runtime/Core/DataStructure/KDTree3D.cs +1 -1
  69. package/Runtime/Core/DataStructure/OctTree3D.cs +1 -1
  70. package/Runtime/Core/Extension/AsyncOperationExtensions.cs +122 -0
  71. package/Runtime/Core/Extension/RandomExtensions.cs +68 -0
  72. package/Runtime/Core/Extension/WallstopStudiosLogger.cs +16 -0
  73. package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +4 -1
  74. package/Runtime/Core/Helper/ReflectionHelpers.cs +21 -10
  75. package/Runtime/Core/Helper/SpriteHelpers.cs +3 -1
  76. package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs +45 -1
  77. package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs +13 -5
  78. package/Runtime/Core/Serialization/JsonConverters/ResolutionConverter.cs +1 -1
  79. package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs +1 -1
  80. package/Runtime/Core/Serialization/ProtobufUnitySurrogates.cs +24 -29
  81. package/Runtime/Core/Serialization/Serializer.cs +101 -0
  82. package/Runtime/Integrations/Reflex/AssemblyInfo.cs +7 -0
  83. package/Runtime/Integrations/Reflex/AssemblyInfo.cs.meta +11 -0
  84. package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs +198 -0
  85. package/Runtime/Integrations/Reflex/ContainerRelationalExtensions.cs.meta +11 -0
  86. package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs +86 -0
  87. package/Runtime/Integrations/Reflex/RelationalComponentsInstaller.cs.meta +11 -0
  88. package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs +316 -0
  89. package/Runtime/Integrations/Reflex/RelationalReflexSceneBootstrapper.cs.meta +11 -0
  90. package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs +86 -0
  91. package/Runtime/Integrations/Reflex/RelationalSceneAssignmentOptions.cs.meta +11 -0
  92. package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef +20 -0
  93. package/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Integration.Reflex.asmdef.meta +7 -0
  94. package/Runtime/Integrations/Reflex.meta +8 -0
  95. package/Runtime/Integrations/VContainer/AssemblyInfo.cs +9 -0
  96. package/Runtime/Integrations/VContainer/AssemblyInfo.cs.meta +3 -0
  97. package/Runtime/Integrations/VContainer/ObjectResolverRelationalExtensions.cs +96 -0
  98. package/Runtime/Integrations/VContainer/RelationalComponentEntryPoint.cs +90 -10
  99. package/Runtime/Integrations/VContainer/RelationalComponentsBuilderExtensions.cs +13 -1
  100. package/Runtime/Integrations/VContainer/RelationalObjectPools.cs +114 -0
  101. package/Runtime/Integrations/VContainer/RelationalObjectPools.cs.meta +11 -0
  102. package/Runtime/Integrations/VContainer/RelationalSceneAssignmentOptions.cs +16 -4
  103. package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs +241 -0
  104. package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs.meta +11 -0
  105. package/Runtime/Integrations/Zenject/AssemblyInfo.cs +9 -0
  106. package/Runtime/Integrations/Zenject/AssemblyInfo.cs.meta +3 -0
  107. package/Runtime/Integrations/Zenject/DiContainerRelationalExtensions.cs +69 -2
  108. package/Runtime/Integrations/Zenject/RelationalComponentSceneInitializer.cs +89 -12
  109. package/Runtime/Integrations/Zenject/RelationalComponentsInstaller.cs +23 -1
  110. package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs +44 -0
  111. package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs.meta +11 -0
  112. package/Runtime/Integrations/Zenject/RelationalSceneAssignmentOptions.cs +16 -10
  113. package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs +243 -0
  114. package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs.meta +11 -0
  115. package/Runtime/Tags/AttributeMetadataCache.cs +1 -4
  116. package/Runtime/Utils/Buffers.cs +4 -4
  117. package/Runtime/Utils/ScriptableObjectSingleton.cs +1 -2
  118. package/Runtime/Utils/SetTextureImportData.cs +3 -1
  119. package/Runtime/Utils/TextureScale.cs +10 -2
  120. package/Runtime/Visuals/UGUI/EnhancedImage.cs +6 -0
  121. package/Runtime/Visuals/UIToolkit/LayeredImage.cs +4 -1
  122. package/Samples~/DI - Reflex/README.md +527 -0
  123. package/Samples~/DI - Reflex/README.md.meta +7 -0
  124. package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs +36 -0
  125. package/Samples~/DI - Reflex/Scripts/ReflexPaletteService.cs.meta +11 -0
  126. package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs +79 -0
  127. package/Samples~/DI - Reflex/Scripts/ReflexRelationalConsumer.cs.meta +11 -0
  128. package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs +30 -0
  129. package/Samples~/DI - Reflex/Scripts/ReflexSampleInstaller.cs.meta +11 -0
  130. package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs +79 -0
  131. package/Samples~/DI - Reflex/Scripts/ReflexSpawner.cs.meta +11 -0
  132. package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef +26 -0
  133. package/Samples~/DI - Reflex/Scripts/Samples.UnityHelpers.DI.Reflex.asmdef.meta +9 -0
  134. package/Samples~/DI - Reflex/Scripts.meta +8 -0
  135. package/Samples~/DI - Reflex.meta +8 -0
  136. package/Samples~/DI - VContainer/README.md +238 -56
  137. package/Samples~/DI - VContainer/Scripts/GameLifetimeScope.cs +22 -4
  138. package/Samples~/DI - VContainer/Scripts/RelationalConsumer.cs +5 -2
  139. package/Samples~/DI - VContainer/Scripts/Spawner.cs +113 -4
  140. package/Samples~/DI - Zenject/README.md +223 -58
  141. package/Samples~/DI - Zenject/Scripts/RelationalConsumer.cs +3 -0
  142. package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs +37 -0
  143. package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs.meta +12 -0
  144. package/Samples~/DI - Zenject/Scripts/SpawnerZenject.cs +74 -3
  145. package/Samples~/Random - PRNG/README.md +2 -1
  146. package/Samples~/Relational Components - Basic/README.md +3 -1
  147. package/Samples~/Serialization - JSON/README.md +2 -1
  148. package/Samples~/Spatial Structures - 2D and 3D/README.md +2 -1
  149. package/Samples~/UGUI - EnhancedImage/README.md +2 -1
  150. package/Samples~/UI Toolkit - MultiFile Selector (Editor)/README.md +2 -1
  151. package/Tests/Editor/Attributes/AnimationEventHelpersTests.cs +16 -0
  152. package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs +32 -34
  153. package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs +41 -0
  154. package/Tests/Editor/Integrations/Reflex/ReflexIntegrationCompilationTests.cs.meta +11 -0
  155. package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef +27 -0
  156. package/Tests/Editor/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Editor.Reflex.asmdef.meta +7 -0
  157. package/Tests/Editor/Integrations/Reflex.meta +8 -0
  158. package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs +21 -18
  159. package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs +164 -0
  160. package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs.meta +11 -0
  161. package/Tests/Editor/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Editor.VContainer.asmdef +2 -1
  162. package/Tests/Editor/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Editor.Zenject.asmdef +3 -2
  163. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs +127 -0
  164. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs.meta +11 -0
  165. package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs +25 -23
  166. package/Tests/Editor/PersistentDirectorySettingsTests.cs +58 -0
  167. package/Tests/Editor/PersistentDirectorySettingsTests.cs.meta +11 -0
  168. package/Tests/Editor/PrefabCheckerReportTests.cs +32 -0
  169. package/Tests/Editor/PrefabCheckerReportTests.cs.meta +11 -0
  170. package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs +63 -0
  171. package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs.meta +11 -0
  172. package/Tests/Editor/Sprites/AnimationCopierWindowTests.cs +1 -1
  173. package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs +38 -0
  174. package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs.meta +11 -0
  175. package/Tests/Editor/Sprites/ScriptableSpriteAtlasEditorTests.cs +1 -1
  176. package/Tests/Editor/Sprites/SpriteCropperAdditionalTests.cs +12 -12
  177. package/Tests/Editor/Sprites/SpriteCropperTests.cs +9 -9
  178. package/Tests/Editor/Sprites/SpritePivotAdjusterTests.cs +3 -3
  179. package/Tests/Editor/Sprites/TexturePlatformNameHelperTests.cs +18 -0
  180. package/Tests/Editor/Sprites/TextureResizerWizardTests.cs +5 -5
  181. package/Tests/Editor/Sprites/TextureSettingsApplierAPITests.cs +3 -3
  182. package/Tests/Editor/Sprites/TextureSettingsApplierWizardAdditionalTests.cs +4 -4
  183. package/Tests/Editor/Sprites/TextureSettingsApplierWizardTests.cs +4 -4
  184. package/Tests/Editor/Tools/ImageBlurToolTests.cs +22 -110
  185. package/Tests/Editor/Utils/CommonTestBase.cs +60 -1
  186. package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs +6 -6
  187. package/Tests/Editor/Windows/FitTextureSizeWindowTests.cs +66 -74
  188. package/Tests/Runtime/Attributes/RelationalComponentInitializerTests.cs +4 -15
  189. package/Tests/Runtime/DataStructures/SpatialTree3DBoundsConsistencyTests.cs +29 -29
  190. package/Tests/Runtime/Extensions/AsyncOperationExtensionsTests.cs +179 -0
  191. package/Tests/Runtime/Extensions/RandomExtensionTests.cs +55 -0
  192. package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs +445 -0
  193. package/Tests/Runtime/Integrations/Reflex/RelationalComponentsReflexTests.cs.meta +11 -0
  194. package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef +28 -0
  195. package/Tests/Runtime/Integrations/Reflex/WallstopStudios.UnityHelpers.Tests.Runtime.Reflex.asmdef.meta +7 -0
  196. package/Tests/Runtime/Integrations/Reflex.meta +8 -0
  197. package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs +257 -221
  198. package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs +91 -0
  199. package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs.meta +11 -0
  200. package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs +251 -233
  201. package/Tests/Runtime/Performance/RandomPerformanceTests.cs +1 -1
  202. package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs +6 -1
  203. package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs +4 -1
  204. package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs +30 -0
  205. package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs.meta +11 -0
  206. package/Tests/Runtime/Serialization/JsonConverterTests.cs +8 -12
  207. package/Tests/Runtime/Serialization/JsonRoundtripComprehensiveTests.cs +4 -9
  208. package/Tests/Runtime/Serialization/JsonSerializationTest.cs +16 -5
  209. package/Tests/Runtime/Serialization/ProtoRoundtripComprehensiveTests.cs +13 -13
  210. package/Tests/Runtime/Serialization/SerializerAdditionalTests.cs +12 -0
  211. package/Tests/Runtime/Serialization/SerializerFileIoTests.cs +105 -0
  212. package/Tests/Runtime/Serialization/SerializerFileIoTests.cs.meta +11 -0
  213. package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs +247 -0
  214. package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs.meta +11 -0
  215. package/Tests/Runtime/TestUtils/CommonTestBase.cs +99 -0
  216. package/Tests/Runtime/TestUtils/ReflexTestSupport.cs +111 -0
  217. package/Tests/Runtime/TestUtils/ReflexTestSupport.cs.meta +12 -0
  218. package/Tests/Runtime/Utils/CoroutineHandlerTests.cs +1 -1
  219. package/Tests/Runtime/Utils/LZMAComprehensiveTests.cs +1 -1
  220. package/Tests/Runtime/Utils/LZMATests.cs +1 -1
  221. package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs +5 -5
  222. package/Tests/Runtime/Visuals/EnhancedImageTests.cs +25 -56
  223. package/Tests/Runtime/Visuals/VisualsTestHelpers.cs +1 -8
  224. package/Tests/TestUtils.meta +8 -0
  225. package/package-lock.json.meta +7 -0
  226. package/package.json +13 -4
  227. package/scripts/check-eol.ps1 +4 -5
  228. package/scripts/lint-tests.ps1 +156 -0
  229. package/scripts/lint-tests.ps1.meta +7 -0
  230. package/scripts/normalize-eol.ps1 +6 -9
  231. package/.github/workflows/csharpier.yml +0 -135
  232. package/CHANGELOG.md +0 -0
  233. package/EFFECTS_SYSTEM.md +0 -242
  234. package/MATH_AND_EXTENSIONS.md +0 -316
  235. package/SPATIAL_TREE_2D_PERFORMANCE.md +0 -238
  236. package/SPATIAL_TREE_3D_PERFORMANCE.md +0 -240
  237. /package/{CHANGELOG.md.meta → Docs/CHANGELOG.md.meta} +0 -0
  238. /package/{DATA_STRUCTURES.md → Docs/DATA_STRUCTURES.md} +0 -0
  239. /package/{DATA_STRUCTURES.md.meta → Docs/DATA_STRUCTURES.md.meta} +0 -0
  240. /package/{EDITOR_TOOLS_GUIDE.md.meta → Docs/EDITOR_TOOLS_GUIDE.md.meta} +0 -0
  241. /package/{EFFECTS_SYSTEM.md.meta → Docs/EFFECTS_SYSTEM.md.meta} +0 -0
  242. /package/{EFFECTS_SYSTEM_TUTORIAL.md.meta → Docs/EFFECTS_SYSTEM_TUTORIAL.md.meta} +0 -0
  243. /package/{GETTING_STARTED.md.meta → Docs/GETTING_STARTED.md.meta} +0 -0
  244. /package/{GLOSSARY.md.meta → Docs/GLOSSARY.md.meta} +0 -0
  245. /package/{HULLS.md → Docs/HULLS.md} +0 -0
  246. /package/{HULLS.md.meta → Docs/HULLS.md.meta} +0 -0
  247. /package/{INDEX.md.meta → Docs/INDEX.md.meta} +0 -0
  248. /package/{LICENSE.md → Docs/LICENSE.md} +0 -0
  249. /package/{LICENSE.md.meta → Docs/LICENSE.md.meta} +0 -0
  250. /package/{MATH_AND_EXTENSIONS.md.meta → Docs/MATH_AND_EXTENSIONS.md.meta} +0 -0
  251. /package/{RANDOM_PERFORMANCE.md.meta → Docs/RANDOM_PERFORMANCE.md.meta} +0 -0
  252. /package/{REFLECTION_HELPERS.md → Docs/REFLECTION_HELPERS.md} +0 -0
  253. /package/{REFLECTION_HELPERS.md.meta → Docs/REFLECTION_HELPERS.md.meta} +0 -0
  254. /package/{RELATIONAL_COMPONENTS.md.meta → Docs/RELATIONAL_COMPONENTS.md.meta} +0 -0
  255. /package/{SERIALIZATION.md.meta → Docs/SERIALIZATION.md.meta} +0 -0
  256. /package/{SINGLETONS.md → Docs/SINGLETONS.md} +0 -0
  257. /package/{SINGLETONS.md.meta → Docs/SINGLETONS.md.meta} +0 -0
  258. /package/{SPATIAL_TREES_2D_GUIDE.md.meta → Docs/SPATIAL_TREES_2D_GUIDE.md.meta} +0 -0
  259. /package/{SPATIAL_TREES_3D_GUIDE.md.meta → Docs/SPATIAL_TREES_3D_GUIDE.md.meta} +0 -0
  260. /package/{SPATIAL_TREE_2D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_2D_PERFORMANCE.md.meta} +0 -0
  261. /package/{SPATIAL_TREE_3D_PERFORMANCE.md.meta → Docs/SPATIAL_TREE_3D_PERFORMANCE.md.meta} +0 -0
  262. /package/{SPATIAL_TREE_SEMANTICS.md → Docs/SPATIAL_TREE_SEMANTICS.md} +0 -0
  263. /package/{SPATIAL_TREE_SEMANTICS.md.meta → Docs/SPATIAL_TREE_SEMANTICS.md.meta} +0 -0
  264. /package/{THIRD_PARTY_NOTICES.md.meta → Docs/THIRD_PARTY_NOTICES.md.meta} +0 -0
@@ -0,0 +1,243 @@
1
+ # 3D Spatial Tree Performance Benchmarks
2
+
3
+ ## TL;DR — What Problem This Solves
4
+
5
+ - Need fast “what’s near X?” or “what’s inside this volume?” in 3D.
6
+ - These structures avoid scanning every object; queries touch only nearby data.
7
+ - Quick picks: OctTree3D for general 3D queries; KDTree3D for nearest‑neighbor on points; RTree3D for volumetric bounds.
8
+
9
+ Note: KdTree3D, OctTree3D, and RTree3D are under active development and their APIs/performance may evolve. SpatialHash3D is stable and recommended for broad‑phase neighbor queries with many moving objects.
10
+
11
+ For boundary and result semantics across structures, see [Spatial Tree Semantics](SPATIAL_TREE_SEMANTICS.md)
12
+
13
+ This document contains performance benchmarks for the 3D spatial tree implementations in Unity Helpers.
14
+
15
+ ## Available 3D Spatial Trees
16
+
17
+ - **OctTree3D** - Easiest to use, good all-around performance for 3D
18
+ - **KDTree3D** - Balanced and unbalanced variants available
19
+ - **RTree3D** - Optimized for 3D bounding box queries
20
+ - **SpatialHash3D** - Efficient for uniformly distributed moving objects (stable)
21
+
22
+ ## Performance Benchmarks
23
+
24
+ <!-- SPATIAL_TREE_3D_BENCHMARKS_START -->
25
+
26
+ ### Datasets
27
+
28
+ <!-- tabs:start -->
29
+
30
+ #### **1,000,000 entries**
31
+
32
+ ##### Construction
33
+
34
+ | Construction | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
35
+ | ----------------- | ------------------- | --------------------- | ---------- | ---------- |
36
+ | 1,000,000 entries | 2 (0.402s) | 3 (0.313s) | 2 (0.430s) | 2 (0.373s) |
37
+
38
+ ##### Elements In Range
39
+
40
+ | Elements In Range | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
41
+ | --------------------------- | ------------------- | --------------------- | --------- | ------- |
42
+ | Full (~span/2) (r=49.50) | 17 | 20 | 31 | 15 |
43
+ | Half (~span/4) (r=24.75) | 127 | 153 | 215 | 150 |
44
+ | Quarter (~span/8) (r=12.38) | 934 | 1,227 | 1,669 | 1,514 |
45
+ | Tiny (~span/1000) (r=1) | 23,479 | 23,665 | 138,186 | 76,631 |
46
+
47
+ ##### Get Elements In Bounds
48
+
49
+ | Get Elements In Bounds | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
50
+ | -------------------------------- | ------------------- | --------------------- | --------- | ------- |
51
+ | Full (size≈99.00x99.00x99.00) | 33 | 35 | 176 | 20 |
52
+ | Half (size≈49.50x49.50x49.50) | 38 | 41 | 1,247 | 262 |
53
+ | Quarter (size≈24.75x24.75x24.75) | 38 | 43 | 3,959 | 2,520 |
54
+ | Unit (size=1) | 39 | 43 | 183,582 | 76,235 |
55
+
56
+ ##### Approximate Nearest Neighbors
57
+
58
+ | Approximate Nearest Neighbors | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
59
+ | ----------------------------- | ------------------- | --------------------- | --------- | ------- |
60
+ | 500 neighbors | 5,895 | 10,193 | 2,302 | 305 |
61
+ | 100 neighbors | 65,079 | 70,085 | 10,904 | 3,349 |
62
+ | 10 neighbors | 403,144 | 416,692 | 16,000 | 7,663 |
63
+ | 1 neighbor | 544,211 | 412,407 | 19,831 | 8,321 |
64
+
65
+ #### **100,000 entries**
66
+
67
+ ##### Construction
68
+
69
+ | Construction | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
70
+ | --------------- | ------------------- | --------------------- | ----------- | ----------- |
71
+ | 100,000 entries | 34 (0.029s) | 47 (0.021s) | 64 (0.015s) | 43 (0.023s) |
72
+
73
+ ##### Elements In Range
74
+
75
+ | Elements In Range | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
76
+ | --------------------------- | ------------------- | --------------------- | --------- | ------- |
77
+ | Full (~span/2) (r=49.50) | 336 | 485 | 770 | 199 |
78
+ | Half (~span/4) (r=24.75) | 1,019 | 1,445 | 2,040 | 853 |
79
+ | Quarter (~span/8) (r=12.38) | 2,567 | 3,993 | 5,989 | 3,443 |
80
+ | Tiny (~span/1000) (r=1) | 26,745 | 29,804 | 176,265 | 101,035 |
81
+
82
+ ##### Get Elements In Bounds
83
+
84
+ | Get Elements In Bounds | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
85
+ | ------------------------------- | ------------------- | --------------------- | --------- | ------- |
86
+ | Full (size≈99.00x99.00x9) | 572 | 718 | 2,636 | 324 |
87
+ | Half (size≈49.50x49.50x4.5) | 662 | 837 | 9,370 | 3,498 |
88
+ | Quarter (size≈24.75x24.75x2.25) | 674 | 861 | 47,400 | 24,236 |
89
+ | Unit (size=1) | 676 | 872 | 246,015 | 101,313 |
90
+
91
+ ##### Approximate Nearest Neighbors
92
+
93
+ | Approximate Nearest Neighbors | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
94
+ | ----------------------------- | ------------------- | --------------------- | --------- | ------- |
95
+ | 500 neighbors | 6,708 | 11,996 | 1,629 | 271 |
96
+ | 100 neighbors | 38,469 | 42,192 | 9,227 | 2,237 |
97
+ | 10 neighbors | 420,942 | 218,972 | 19,122 | 7,481 |
98
+ | 1 neighbor | 459,844 | 327,816 | 29,943 | 11,842 |
99
+
100
+ #### **10,000 entries**
101
+
102
+ ##### Construction
103
+
104
+ | Construction | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
105
+ | -------------- | ------------------- | --------------------- | ------------ | ------------ |
106
+ | 10,000 entries | 378 (0.003s) | 467 (0.002s) | 585 (0.002s) | 442 (0.002s) |
107
+
108
+ ##### Elements In Range
109
+
110
+ | Elements In Range | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
111
+ | --------------------------- | ------------------- | --------------------- | --------- | ------- |
112
+ | Full (~span/2) (r=49.50) | 4,775 | 4,609 | 8,940 | 2,207 |
113
+ | Half (~span/4) (r=24.75) | 5,940 | 6,484 | 8,824 | 4,285 |
114
+ | Quarter (~span/8) (r=12.38) | 5,911 | 6,909 | 11,123 | 7,540 |
115
+ | Tiny (~span/1000) (r=1) | 41,201 | 39,120 | 218,463 | 160,263 |
116
+
117
+ ##### Get Elements In Bounds
118
+
119
+ | Get Elements In Bounds | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
120
+ | ------------------------------ | ------------------- | --------------------- | --------- | ------- |
121
+ | Full (size≈99.00x9x9) | 5,944 | 5,974 | 26,136 | 3,587 |
122
+ | Half (size≈49.50x4.5x4.5) | 6,709 | 6,761 | 46,124 | 37,467 |
123
+ | Quarter (size≈24.75x2.25x2.25) | 6,843 | 6,878 | 167,117 | 120,365 |
124
+ | Unit (size=1) | 6,935 | 6,923 | 313,373 | 161,932 |
125
+
126
+ ##### Approximate Nearest Neighbors
127
+
128
+ | Approximate Nearest Neighbors | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
129
+ | ----------------------------- | ------------------- | --------------------- | --------- | ------- |
130
+ | 500 neighbors | 9,797 | 10,570 | 636 | 185 |
131
+ | 100 neighbors | 48,860 | 69,836 | 5,909 | 2,233 |
132
+ | 10 neighbors | 463,086 | 416,036 | 26,962 | 12,808 |
133
+ | 1 neighbor | 622,715 | 624,381 | 45,121 | 21,542 |
134
+
135
+ #### **1,000 entries**
136
+
137
+ ##### Construction
138
+
139
+ | Construction | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
140
+ | ------------- | ------------------- | --------------------- | -------------- | -------------- |
141
+ | 1,000 entries | 3,828 (0.000s) | 1,431 (0.001s) | 4,177 (0.000s) | 4,058 (0.000s) |
142
+
143
+ ##### Elements In Range
144
+
145
+ | Elements In Range | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
146
+ | -------------------------- | ------------------- | --------------------- | --------- | ------- |
147
+ | Full (~span/2) (r=4.5) | 12,017 | 13,682 | 24,546 | 21,261 |
148
+ | Half (~span/4) (r=2.25) | 52,394 | 62,385 | 124,579 | 149,723 |
149
+ | Quarter (~span/8) (r=1.13) | 62,668 | 64,358 | 339,716 | 228,054 |
150
+ | Tiny (~span/1000) (r=1) | 62,670 | 64,483 | 340,166 | 228,438 |
151
+
152
+ ##### Get Elements In Bounds
153
+
154
+ | Get Elements In Bounds | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
155
+ | ----------------------------- | ------------------- | --------------------- | --------- | ------- |
156
+ | Full (size≈9x9x9) | 54,554 | 59,700 | 321,423 | 35,729 |
157
+ | Half (size≈4.5x4.5x4.5) | 59,218 | 65,748 | 199,393 | 177,785 |
158
+ | Quarter (size≈2.25x2.25x2.25) | 59,744 | 67,219 | 501,086 | 234,106 |
159
+ | Unit (size=1) | 59,712 | 68,104 | 475,751 | 234,738 |
160
+
161
+ ##### Approximate Nearest Neighbors
162
+
163
+ | Approximate Nearest Neighbors | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
164
+ | ----------------------------- | ------------------- | --------------------- | --------- | ------- |
165
+ | 500 neighbors | 15,553 | 14,623 | 3,259 | 621 |
166
+ | 100 neighbors | 70,256 | 65,840 | 15,632 | 4,130 |
167
+ | 10 neighbors | 439,459 | 413,712 | 74,432 | 32,538 |
168
+ | 1 neighbor | 691,682 | 657,381 | 84,606 | 43,414 |
169
+
170
+ #### **100 entries**
171
+
172
+ ##### Construction
173
+
174
+ | Construction | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
175
+ | ------------ | ------------------- | --------------------- | --------------- | --------------- |
176
+ | 100 entries | 39,370 (0.000s) | 33,003 (0.000s) | 26,246 (0.000s) | 20,746 (0.000s) |
177
+
178
+ ##### Elements In Range
179
+
180
+ | Elements In Range | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
181
+ | -------------------------- | ------------------- | --------------------- | --------- | ------- |
182
+ | Full (~span/2) (r=4.5) | 126,263 | 127,269 | 296,006 | 195,890 |
183
+ | Half (~span/4) (r=2.25) | 147,197 | 149,386 | 318,618 | 311,821 |
184
+ | Quarter (~span/8) (r=1.13) | 147,516 | 150,720 | 393,623 | 420,109 |
185
+ | Tiny (~span/1000) (r=1) | 147,471 | 150,688 | 395,500 | 405,202 |
186
+
187
+ ##### Get Elements In Bounds
188
+
189
+ | Get Elements In Bounds | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
190
+ | ----------------------- | ------------------- | --------------------- | --------- | ------- |
191
+ | Full (size≈9x4x1) | 501,997 | 505,246 | 1,807,410 | 329,640 |
192
+ | Half (size≈4.5x2x1) | 498,779 | 534,318 | 494,122 | 456,745 |
193
+ | Quarter (size≈2.25x1x1) | 537,627 | 536,488 | 776,653 | 726,561 |
194
+ | Unit (size=1) | 539,253 | 536,541 | 776,990 | 721,307 |
195
+
196
+ ##### Approximate Nearest Neighbors
197
+
198
+ | Approximate Nearest Neighbors | KDTree3D (Balanced) | KDTree3D (Unbalanced) | OctTree3D | RTree3D |
199
+ | ----------------------------- | ------------------- | --------------------- | --------- | ------- |
200
+ | 100 neighbors (max) | 92,014 | 88,119 | 69,346 | 62,009 |
201
+ | 10 neighbors | 617,049 | 514,543 | 105,140 | 100,817 |
202
+ | 1 neighbor | 872,834 | 636,275 | 172,544 | 221,636 |
203
+
204
+ <!-- tabs:end -->
205
+ <!-- SPATIAL_TREE_3D_BENCHMARKS_END -->
206
+
207
+ ## Interpreting the Results
208
+
209
+ All numbers represent **operations per second** (higher is better), except for construction times which show operations per second and absolute time.
210
+
211
+ ### Choosing the Right Tree
212
+
213
+ **OctTree3D**:
214
+
215
+ - Best for: General-purpose 3D spatial queries
216
+ - Strengths: Balanced performance, easy to use, good spatial locality
217
+ - Use cases: 3D collision detection, visibility culling, spatial audio
218
+
219
+ **KDTree3D (Balanced)**:
220
+
221
+ - Best for: Nearest-neighbor queries in 3D space
222
+ - Strengths: Fast point queries, good for smaller datasets
223
+ - Use cases: Pathfinding, AI spatial awareness, particle systems
224
+
225
+ **KDTree3D (Unbalanced)**:
226
+
227
+ - Best for: When you need fast construction and will rebuild frequently
228
+ - Strengths: Fastest construction, similar query performance to balanced
229
+ - Use cases: Dynamic environments, frequently changing spatial data
230
+
231
+ **RTree3D**:
232
+
233
+ - Best for: 3D bounding box queries, especially with volumetric data
234
+ - Strengths: Excellent for large bounding volumes, handles overlapping objects
235
+ - Use cases: Physics engines, frustum culling, volumetric effects
236
+
237
+ ### Important Notes
238
+
239
+ - All spatial trees assume **immutable** positional data
240
+ - If positions change, you must reconstruct the tree
241
+ - Spatial queries are O(log n) vs O(n) for linear search
242
+ - 3D trees have higher construction costs than 2D variants due to additional dimension
243
+ - Construction cost is amortized over many queries
@@ -27,7 +27,7 @@ Full License Texts
27
27
 
28
28
  Apache License
29
29
  Version 2.0, January 2004
30
- [http://www.apache.org/licenses/](http://www.apache.org/licenses/)
30
+ [https://www.apache.org/licenses/](https://www.apache.org/licenses/)
31
31
 
32
32
  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
33
33