コード例 #1
0
 public NeuronsCircle(ProxList list, Vector2 origin, Vector2 offset, Vector2 gravity)
 {
     _list           = list;
     circle_origin   = origin;
     circle_offset   = offset;
     gravity_force   = gravity;
     circle_position = list.Add(circle_origin + circle_offset);
 }
コード例 #2
0
ファイル: Neurons.cs プロジェクト: Morbidous/DownUnder-UI
        protected override void Initialize()
        {
            prox_list = new ProxList(Proximity, Widget.MAXIMUM_WIDGET_SIZE, Widget.MAXIMUM_WIDGET_SIZE);

            var area = new RectangleF(0, 0, 1920 + 400, 1080 + 400);

            //Parent.Area.SizeOnly().ResizedBy(100f, Directions2D.DR);

            for (var i = 0; i < circle_count; i++)
            {
                circles.Add(NeuronsCircle.RandomCircle(prox_list, area));
            }

            if (Parent.ParentDWindow is null)
            {
                return;
            }

            LoadContent(this, EventArgs.Empty);
        }
コード例 #3
0
        public static NeuronsCircle RandomCircle(ProxList list, RectangleF area)
        {
            var random = new Random();

            var x_offset = random.Next(10000) / 10000f * list.InteractDiameter * 2 - list.InteractDiameter;
            var y_offset = random.Next(10000) / 10000f * list.InteractDiameter * 2 - list.InteractDiameter;

            var circle_origin = new Vector2(random.Next((int)area.Width), random.Next((int)area.Height)) + area.Position;
            var circle_offset = new Vector2(x_offset, y_offset);
            var gravity_force = new Vector2(0.0005f + random.Next(1000) * 0.00001f, 0.0005f + random.Next(1000) * 0.00001f);

            var result = new NeuronsCircle(list, circle_origin, circle_offset, gravity_force);
            var mixup  = random.Next(100);

            for (var i = 0; i < mixup; i++)
            {
                result.Update(0.5f);
            }

            return(result);
        }
コード例 #4
0
 public NeuronsCircle(ProxList list)
 {
     _list           = list;
     circle_position = list.Add(new Point2());
 }