From d04dd8cfeb6109b7b8b393d54e2c1da720d5e06d Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Wed, 7 Mar 2007 20:28:43 +0000 Subject: [PATCH] updated per recommendation from ray git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4620 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/Line.as | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/as/com/threerings/util/Line.as b/src/as/com/threerings/util/Line.as index 71ead6e38..1e3cc367e 100644 --- a/src/as/com/threerings/util/Line.as +++ b/src/as/com/threerings/util/Line.as @@ -42,16 +42,21 @@ public class Line this.stop = stop; } + public function isIntersected (line :Line) :Boolean + { + return getIntersectionType(line) != DOES_NOT_INTERSECT; + } + /** - * Tests if the given line intersects this line. If thats all you need to know, testing for - * intersects() != DOES_NOT_INTERSECT is enough. This method rotates both lines so that the - * start point is on the left. If the lines do intersect, it then returns INTERSECTION_NORTH - * if the end point of line is north of this line, INTERSECTION_SOUTH otherwise. + * Tests if the given line intersects this line. This method rotates both lines so that the + * start point of this line is on the left, at (0, 0). If the lines do intersect, it then + * returns INTERSECTION_NORTH if the end point of line is north of this line, + * INTERSECTION_SOUTH otherwise. * * Intersections are inclusive. If one or both points lands on this line, interects will not * return DOES_NOT_INTERSECT. */ - public function intersects (line :Line) :int + public function getIntersectionType (line :Line) :int { // rotate so that this line is horizontal, with the start on the left, at (0, 0) var trans :Matrix = new Matrix();