Skip to main content

Module spatial

Module spatial 

Source
Expand description

Spatial acceleration structures for fast proximity queries.

§Structures

  • SpatialGrid — uniform 3D grid (O(1) insert, O(k) range query)
  • SpatialGrid2D — 2D version for screen-space queries
  • BvhNode — bounding volume hierarchy for static geometry
  • KdTree — k-d tree for nearest-neighbor queries
  • SpatialIndex — unified trait for all spatial structures

Used for:

  • Fast glyph proximity (cohesion, repulsion forces)
  • Collision detection between entities
  • Field influence queries
  • Particle flocking neighbor search

Structs§

Aabb
Axis-aligned bounding box in 3D.
Bvh
A complete BVH tree.
Frustum
A camera frustum for view culling.
KdTree
A 3D k-d tree for efficient nearest-neighbor queries.
SpatialGrid
A uniform 3D spatial hash grid.
SpatialGrid2D
A uniform 2D spatial hash grid for screen-space queries.

Enums§

BvhNode
A node in a Bounding Volume Hierarchy.

Traits§

SpatialIndex
Common interface for spatial acceleration structures.

Functions§

batch_radius_query
Find all positions within radius of any of the given query_points.
find_close_pairs
Find all pairs of points closer than max_dist.