public void Dispose() { UnsafeNodesList.Destroy(nodesList); nodesList = null; insertionHeap.Dispose(); rootIndex.Dispose(); }
public NativeBVHTree(int initialCapacity = 64, Allocator allocator = Allocator.Temp, Configuration config = default) : this() { nodesList = UnsafeNodesList.Create(initialCapacity, allocator, NativeArrayOptions.ClearMemory); rootIndex = new NativeArray <int>(1, allocator); // Create invalid node (at index 0) AllocInternalNode(); this.config = config; }