Ejemplo n.º 1
0
        public bool CollidesWith(OrientedRectangle orientedRectangle)
        {
            Rectangle orHull = orientedRectangle.RectangleHull();
            if (!orHull.CollidesWith(this))
            {
                return false;
            }

            LineSegment edge = orientedRectangle.Edge(0);
            if (edge.SeparatingAxisForRectangle(this))
            {
                return false;
            }

            edge = orientedRectangle.Edge(1);

            return !edge.SeparatingAxisForRectangle(this);
        }