Пример #1
0
 private void CheckAddRegion(SlopeRegion _region)
 {
     if (_region.m_slope != float.MaxValue)
     {
         m_sweepRegions.Add(_region);
     }
     else
     {
         SlopeRegion.Pool.GiveBack(_region);
     }
 }
Пример #2
0
        public void TurnReion(Point2 _site)
        {
            Point2 _right;

            if (_site.m_right.x > _site.m_left.x)
            {
                _right = _site.m_right;
            }
            else
            {
                _right = _site.m_left;
            }
            RemoveEndwith(_site);
            var         _toRight = _right.getValue() - _site.getValue();
            SlopeRegion _region  = SlopeRegion.Pool.Take.SetValue(_site, _right);

            _region.m_slope = SlopeOf(_toRight);
            CheckAddRegion(_region);
            SetSweepTo(_site.x);
        }
Пример #3
0
        public void OpenRegion(Point2 _site)
        {
            SlopeRegion _regionHi = SlopeRegion.Pool.Take.SetValue(_site, _site.m_left);
            var         _toLeft   = _site.m_left.getValue() - _site.getValue();

            _regionHi.m_slope = SlopeOf(_toLeft);

            SlopeRegion _regionLow = SlopeRegion.Pool.Take.SetValue(_site, _site.m_right);
            var         _toRight   = _site.m_right.getValue() - _site.getValue();

            _regionLow.m_slope = SlopeOf(_toRight);

            if (_toLeft.y < _toRight.y)
            {
                var _temp = _regionHi;
                _regionHi  = _regionLow;
                _regionLow = _temp;
            }
            CheckAddRegion(_regionHi);
            CheckAddRegion(_regionLow);
            SetSweepTo(_site.x);
        }