Example #1
0
        //[WriteOnly]
        //public NativeQueue<float4>.ParallelWriter dstGridPositions;
        //[WriteOnly]
        //public NativeList<uint> dstCubes;

        public void Execute()
        {
            var id = 0;

            for (var i = 0; i < this.srcCubeGrids.Length; i++)
            {
                var g   = this.srcCubeGrids[i];
                var ggg = new CubeNearGridsNativeArray
                {
                    current         = NativeUtility.PtrToNativeArray(g.current, 32 * 32),
                    current_right   = NativeUtility.PtrToNativeArray(g.current_right, 32 * 32),
                    back            = NativeUtility.PtrToNativeArray(g.back, 32 * 32),
                    back_right      = NativeUtility.PtrToNativeArray(g.back_right, 32 * 32),
                    under           = NativeUtility.PtrToNativeArray(g.under, 32 * 32),
                    under_right     = NativeUtility.PtrToNativeArray(g.under_right, 32 * 32),
                    backUnder       = NativeUtility.PtrToNativeArray(g.backUnder, 32 * 32),
                    backUnder_right = NativeUtility.PtrToNativeArray(g.backUnder_right, 32 * 32)
                };
                var isCubeAdded = ggg.SampleAllCubes(id, this.dstCubes);
                if (isCubeAdded)
                {
                    this.dstGridPositions.Add(new float4(id * 32, -0 * 32, -0 * 32, 0));
                    id++;
                }
            }
        }