Import std.collections.spatial
Octree
class
@DebugElements Public Class Octree<T> Implements Iterable<T>, Cloneable
Values at 3D points, in bounds it splits in eight where points crowd.
Examples
Local tree = Octree<String>(0, 0, 0, 100, 100, 100)
tree.Add("a", 10, 10, 10)
tree.Add("b", 90, 90, 90)
Expect(tree.Near(0, 0, 0, 20) == ["a"])
Expect(tree.Count == 2)std/collections/spatial.fb, line 650
-
@PanicsAtCaller Public New(minX: Float, minY: Float, minZ: Float, maxX: Float, maxY: Float, maxZ: Float)constructor #An empty Octree for the points in the box from (
minX,minY,minZ) to (maxX,maxY,maxZ), which has to be finite. A box whose max is below its min along an axis panics. -
How many values it holds.
-
Adds the
valueat (x,y,z). A point outside the Octree's box panics. -
Removes the first
valueequal tovalueat (x,y,z), and tells whether there was one. -
Whether a value equal to
valueis at (x,y,z). -
@PanicsAtCaller Public Method Move(value: T, x: Float, y: Float, z: Float, toX: Float, toY: Float, toZ: Float): Boolmethod #Moves the first
valueequal tovalueat (x,y,z) to (toX,toY,toZ), and tells whether there was one. A point outside the Octree's box panics. -
Takes every value out.
-
@PanicsAtCaller Public Method Query(minX: Float, minY: Float, minZ: Float, maxX: Float, maxY: Float, maxZ: Float): T[]method #The values in the box from (
minX,minY,minZ) to (maxX,maxY,maxZ), in a new array. -
The values no more than
radiusfrom (x,y,z), in a new array. -
Every value, in a new array.
-
A new Octree with the same box and values at the same points.
-
Every value. Adding or removing one while going over them panics.
Report an issue with this page or with FutureBlitz on GitHub.