Example #1
0
        public override bool Overlaps(Rect rect)
        {
            if (base.Overlaps(rect))
            {
                for (int a = 0; a < m_RenderPoints.Count - 1; a++)
                {
                    if (RectUtils.IntersectsSegment(rect, m_RenderPoints[a], m_RenderPoints[a + 1]))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
        public override bool Overlaps(Rect rect)
        {
            for (int a = 0; a < m_RenderPoints.Count - 1; a++)
            {
                var segmentA = new Vector2(m_RenderPoints[a].x, m_RenderPoints[a].y);
                var segmentB = new Vector2(m_RenderPoints[a + 1].x, m_RenderPoints[a + 1].y);

                if (RectUtils.IntersectsSegment(rect, segmentA, segmentB))
                {
                    return(true);
                }
            }

            return(false);
        }
Example #3
0
        public override bool Overlaps(Rect rect)
        {
            bool result;

            for (int i = 0; i < this.m_RenderPoints.Count - 1; i++)
            {
                Vector2 p  = new Vector2(this.m_RenderPoints[i].x, this.m_RenderPoints[i].y);
                Vector2 p2 = new Vector2(this.m_RenderPoints[i + 1].x, this.m_RenderPoints[i + 1].y);
                if (RectUtils.IntersectsSegment(rect, p, p2))
                {
                    result = true;
                    return(result);
                }
            }
            result = false;
            return(result);
        }