import {ObjectsKdTree3} from '@xeokit/xeokit-sdk/src/extras/collision/ObjectsKdTree3.js'
ObjectsKdTree3
Automatically indexes a Viewer's Entitys in a 3D k-d tree to support fast collision detection with 3D World-space axis-aligned boundaries (AABBs) and frustums.
See MarqueePicker for usage example.
An ObjectsKdTree3 is configured with a Viewer, and will then automatically keep itself populated with k-d nodes that contain the Viewer's Entitys.
We can then traverse the k-d nodes, starting at ObjectsKdTree3#root, to find the contained Entities.
Constructor Summary
Public Constructor | ||
public |
constructor(cfg: *) Creates an ObjectsKdTree3. |
Member Summary
Public Members | ||
public get |
root: * Gets the root ObjectsKdTree3 node. |
|
public |
viewer: * |
Method Summary
Public Methods | ||
public |
destroy() Destroys this ObjectsKdTree3. |
Public Constructors
Public Members
public get root: * source
Gets the root ObjectsKdTree3 node.
Each time this accessor is accessed, it will lazy-rebuild the ObjectsKdTree3 if Entitys have been created or removed in the Viewer since the last time it was accessed.
public viewer: * source
Public Methods
public destroy() source
Destroys this ObjectsKdTree3.
Does not destroy the Viewer given to the constructor of the ObjectsKdTree3.