Unity Helpers

Logo

Treasure chest of Unity developer tools. Professional inspector tooling, high-performance utilities, spatial queries, and 20+ editor tools.

Spatial Tree Semantics

TL;DR — Why Semantics Matter

This page explains how the 2D and 3D spatial structures compare in terms of correctness, when to use each structure, and why some 3D variants may produce different results for identical inputs and queries.

Result Buffers

Structures At A Glance

Illustrations:

QuadTree2D

KDTree2D

RTree2D

3D Variants

Octree3D

KDTree3D

RTree3D

Diagram notes

2D: Consistent Results Across QuadTree2D and KdTree2D

When To Use (2D)

3D: Why KdTree3D and OctTree3D Can Differ

While KdTree3D and OctTree3D are both point‑based and target equivalent use cases, algorithmic choices can yield different edge‑case behavior for identical inputs/queries.

Key reasons and scenarios:

3D: RTree3D Semantics

Guidance

Boundary Semantics

Query Boundaries

Tips

Cheat Sheet