A spatial data structure for quick point queries suited for moving or concentrated positions in 3D space. The dense variant uses much, much more memory in 3D, but is slightly faster for insertions and removals than the sparse variant. More...
Public Member Functions | |
void | Clear () |
Clears and resets the tree without deallocating memory. | |
void | Dispose () |
void | DisposeIfCreated () |
float3 | GetBottomLeftPosition () |
bool | GetCell (float3 position, out uint code) |
int3 | GetCellCoordinates (float3 position) |
JobHandle | GetCellsInBounds (Bounds bounds, ref NativeList< uint > result, JobHandle dependsOn=default) |
Searches for all cells within the given bounds and writes the morton code (cell ids) to a result-list. | |
JobHandle | GetCellsInBounds (NativeArray< Bounds > bounds, ref NativeParallelHashSet< uint > result, JobHandle dependsOn=default, int innerLoopBatchCount=1) |
Searches for all cells within all given bounds and writes the morton code (cell ids) to a result-list. | |
JobHandle | GetCellsInRadii (NativeArray< float3 > centers, NativeArray< float > radii, ref NativeParallelHashSet< uint > result, JobHandle dependsOn=default, int innerLoopBatchCount=1) |
Searches for all cells within multiple spheres (center + radius) and writes the morton code (cell ids) to a result-list. | |
JobHandle | GetCellsInRadius (float3 center, float radius, ref NativeList< uint > result, JobHandle dependsOn=default) |
Searches for all cells within a given sphere (center + radius) and writes the morton code (cell ids) to a result-list. | |
NativeParallelMultiHashMap< uint, T > | GetDataBuckets () |
int | GetMaxDepth () |
NativeList< OctreeNode > | GetNodes () |
OctreeNode * | GetRoot () |
float3 | GetScale () |
void | Insert (float3 position, T value) |
Inserts a value at a given position into the tree. | |
NativeDenseOctree (Bounds bounds, int maxDepth, int capacity, Allocator allocator) | |
NativeDenseOctree (float3 position, float3 scale, int maxDepth, int capacity, Allocator allocator) | |
bool | Remove (float3 position, T value) |
bool | Update (T value, float3 oldPosition, float3 newPosition) |
![]() |
Properties | |
int | Count [get] |
bool | IsCreated [get] |
![]() |
A spatial data structure for quick point queries suited for moving or concentrated positions in 3D space. The dense variant uses much, much more memory in 3D, but is slightly faster for insertions and removals than the sparse variant.
T |
T | : | unmanaged | |
T | : | IEquatable<T> |
NativeDenseOctree | ( | Bounds | bounds, |
int | maxDepth, | ||
int | capacity, | ||
Allocator | allocator ) |
bounds | Bounds of the octree |
maxDepth | Maximum depth / height of the octree - also determines the number of cells |
capacity | |
allocator |
NativeDenseOctree | ( | float3 | position, |
float3 | scale, | ||
int | maxDepth, | ||
int | capacity, | ||
Allocator | allocator ) |
position | Center of the octree |
scale | The size of the octree in meters |
maxDepth | Maximum depth / height of the octree - also determines the number of cells |
capacity | |
allocator |
void Clear | ( | ) |
Clears and resets the tree without deallocating memory.
Implements IOctree< T >.
float3 GetBottomLeftPosition | ( | ) |
Implements IOctree< T >.
bool GetCell | ( | float3 | position, |
out uint | code ) |
position | |
code |
int3 GetCellCoordinates | ( | float3 | position | ) |
position |
Implements IOctree< T >.
JobHandle GetCellsInBounds | ( | Bounds | bounds, |
ref NativeList< uint > | result, | ||
JobHandle | dependsOn = default ) |
Searches for all cells within the given bounds and writes the morton code (cell ids) to a result-list.
bounds | |
result | |
dependsOn |
Implements IOctree< T >.
JobHandle GetCellsInBounds | ( | NativeArray< Bounds > | bounds, |
ref NativeParallelHashSet< uint > | result, | ||
JobHandle | dependsOn = default, | ||
int | innerLoopBatchCount = 1 ) |
Searches for all cells within all given bounds and writes the morton code (cell ids) to a result-list.
bounds | |
result | |
dependsOn |
Implements IOctree< T >.
JobHandle GetCellsInRadii | ( | NativeArray< float3 > | centers, |
NativeArray< float > | radii, | ||
ref NativeParallelHashSet< uint > | result, | ||
JobHandle | dependsOn = default, | ||
int | innerLoopBatchCount = 1 ) |
Searches for all cells within multiple spheres (center + radius) and writes the morton code (cell ids) to a result-list.
center | |
radius | |
result | |
dependsOn |
Implements IOctree< T >.
JobHandle GetCellsInRadius | ( | float3 | center, |
float | radius, | ||
ref NativeList< uint > | result, | ||
JobHandle | dependsOn = default ) |
Searches for all cells within a given sphere (center + radius) and writes the morton code (cell ids) to a result-list.
center | |
radius | |
result | |
dependsOn |
Implements IOctree< T >.
NativeParallelMultiHashMap< uint, T > GetDataBuckets | ( | ) |
Implements IOctree< T >.
int GetMaxDepth | ( | ) |
Implements IOctree< T >.
NativeList< OctreeNode > GetNodes | ( | ) |
Implements IOctree< T >.
OctreeNode * GetRoot | ( | ) |
Implements IOctree< T >.
float3 GetScale | ( | ) |
Implements IOctree< T >.
void Insert | ( | float3 | position, |
T | value ) |
Inserts a value at a given position into the tree.
position | |
value |
Implements IOctree< T >.
bool Remove | ( | float3 | position, |
T | value ) |
position | |
value |
Implements IOctree< T >.
bool Update | ( | T | value, |
float3 | oldPosition, | ||
float3 | newPosition ) |
value | |
oldPosition | |
newPosition |
Implements IOctree< T >.
|
get |
Implements IOctree< T >.
|
get |
Implements IOctree< T >.