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. | |
NativeSparseOctree (Bounds bounds, int maxDepth, int capacity, Allocator allocator) | |
NativeSparseOctree (float3 position, float3 scale, int maxDepth, int capacity, Allocator allocator) | |
bool | Remove (float3 position, T value) |
bool | Update (T value, float3 oldPosition, float3 newPosition) |
Important Note: If you have a lot of things moving in the octree, it will be a lot cheaper performance-wise to recreate the whole tree by calling Clear() and then reinserting each element. | |
![]() |
Properties | |
int | Count [get] |
bool | IsCreated [get] |
![]() |
NativeSparseOctree | ( | 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 |
NativeSparseOctree | ( | 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 ) |
Important Note: If you have a lot of things moving in the octree, it will be a lot cheaper performance-wise to recreate the whole tree by calling Clear() and then reinserting each element.
value | |
oldPosition | |
newPosition |
Implements IOctree< T >.
|
get |
Implements IOctree< T >.
|
get |
Implements IOctree< T >.