Exemplo n.º 1
0
        public bool IntersectsWith(RectangleF rect)
        {
            float minx = Math.Max(m_x, rect.m_x);
            float miny = Math.Max(m_y, rect.m_y);
            float maxx = Math.Min(m_x + m_width, rect.X + rect.Width);
            float maxy = Math.Min(m_y + m_height, rect.Y + rect.Height);

            if ( minx>maxx ) return false;
            if ( miny>maxy ) return false;
            return (maxx - minx) * (maxy - miny) > 0;
        }
Exemplo n.º 2
0
        public bool Contains(RectangleF rect)
        {
            float minx = Math.Max(m_x, rect.X);
            float miny = Math.Max(m_y, rect.Y);
            float maxx = Math.Min(m_x + m_width, rect.m_x + rect.Width);
            float maxy = Math.Min(m_y + m_height, rect.m_y + rect.Height);

            if (minx > maxx) return false;
            if (miny > maxy) return false;
            return (maxx - minx) * (maxy - miny) == rect.Width * rect.Height;
        }
Exemplo n.º 3
0
 static public bool isVisible(Camera camera, RectangleF box)
 {
     return false;
 }