Exemple #1
0
 public void Dispose()
 {
     UnsafeNodesList.Destroy(nodesList);
     nodesList = null;
     insertionHeap.Dispose();
     rootIndex.Dispose();
 }
Exemple #2
0
        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;
        }