note: this was a programming experiment
To create a Quadtree where
- all nodes are kept in linear order one index next to the other
- nodes and points are stored in separate, dedicated array/list buffers
| // src* https://gist.github.com/andrew-raphael-lukasik/530e90ee27cd7a9be47351e03b2634d1 | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.Jobs; | |
| using Unity.Entities; | |
| using Unity.Transforms; | |
| using Unity.Rendering; | |
| using Unity.Collections; | |
| using Unity.Mathematics; |
seed: 46473452
| (reference) | new Random( Seed * (uint)( index + 1 ) ).NextInt() | new Random( Seed + (uint)( index * Results.Length ) ).NextInt() | Random.CreateFromIndex( Seed ^ (uint)index ).NextInt() | new Random( Seed * Random.CreateFromIndex( (uint)index ).NextUInt() ).NextInt() | new Random( Seed * Random.CreateFromIndex( (uint)index ).state ).NextInt() | new Random( new Random( Seed * Random.CreateFromIndex( (uint)index ).NextUInt() ).NextUInt() ).NextInt() |
|---|---|---|---|---|---|---|
| -37321856 | -37321856 | -37321856 | 501644091 | 673738796 | 2057345775 | -477813603 |
| -1687388613 | 2073921280 | -97452083 | -1206518005 | 327600797 | -2026729932 | -1871146698 |
| -2118002258 | -421164753 | -83806521 | -530221473 | -1985565071 | 1850284329 | -781137724 |
| -462119340 | 2000358945 | -128750088 | -2079259769 | -20976 |