예제 #1
0
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Polyline polyline = entity as Polyline;

            if (polyline == null)
            {
                return(false);
            }

            Bounding pkBounding = pkbox.reservedBounding;

            for (int i = 1; i < polyline.NumberOfVertices; ++i)
            {
                Line2 line = new Line2(
                    polyline.GetPointAt(i - 1),
                    polyline.GetPointAt(i));

                if (LineHitter.BoundingIntersectWithLine(pkBounding, line))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #2
0
        internal override bool Hit(PickupBox pkbox, Entity entity)
        {
            Line line = entity as Line;

            if (line == null)
            {
                return(false);
            }

            Bounding pkBounding = pkbox.reservedBounding;

            return(LineHitter.BoundingIntersectWithLine(
                       pkBounding,
                       new Line2(line.startPoint, line.endPoint)));
        }