Efficient spatial querying and coarse collision detection using 3D k-d trees, rays, and bounding volumes
What this module provides
This module centers around KdTree3, a k-d tree that indexes items by their axis-aligned bounding boxes (AABBs).
Building a KdTree3 up-front lets you run fast queries such as:
“Which objects intersect this AABB?”
“Which objects are inside (or intersect) the camera frustum?”
“Which objects does this picking ray hit?”
In practice, this is a high-performance way to reduce the number of candidates before doing more expensive, exact tests.
Build a k-d tree
Choose one of the builders depending on what you want to index:
createPrimsKdTree3 — Indexes geometry primitives (triangles/lines/points) from raw arrays.
kdtree3 — 3D Spatial Search & Collision Utilities
Efficient spatial querying and coarse collision detection using 3D k-d trees, rays, and bounding volumes
What this module provides
This module centers around KdTree3, a k-d tree that indexes items by their axis-aligned bounding boxes (AABBs). Building a
KdTree3up-front lets you run fast queries such as:In practice, this is a high-performance way to reduce the number of candidates before doing more expensive, exact tests.
Build a k-d tree
Choose one of the builders depending on what you want to index:
SceneObjects, using world-space bounds.SceneObjects, using their world-space bounds.Query a k-d tree
Once built, you can query the tree with common spatial volumes:
Typical use cases
Installation
Example: find SceneObjects intersecting an AABB