Example #1
0
        public void Step()
        {
            var      r    = r0 + 5;
            var      rmax = r0 + 10;
            Partical p    = new Partical();

            p.RndInit(r);
            while (true)
            {
                var dist = p.magnitude;
                if (IsSurround(p.position))
                {
                    SetPixel(p.position);
                    if (dist > r0)
                    {
                        r0 = dist;
                    }
                    break;
                }
                if (dist > rmax)
                {
                    break;
                }
                p.BrownianMotion();
            }
        }
Example #2
0
        public void Init(int cs)
        {
            CubeSize = cs;
            Partical.InitMovTab();
            var size = CubeSize * 2 + 1;

            pixels = new bool[size, size, size];
            SetPixel(Vector3Int.zero);
            r0 = 5;
        }