diff --git a/src/java/com/threerings/util/DirectionUtil.java b/src/java/com/threerings/util/DirectionUtil.java index 02ae5c0e7..79b23b922 100644 --- a/src/java/com/threerings/util/DirectionUtil.java +++ b/src/java/com/threerings/util/DirectionUtil.java @@ -1,5 +1,5 @@ // -// $Id: DirectionUtil.java,v 1.11 2004/08/27 02:20:36 mdb Exp $ +// $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved @@ -143,7 +143,7 @@ public class DirectionUtil implements DirectionCodes */ public static int getDirection (Point a, Point b) { - return getDirection(a.x, a.y, b.x, b.y); + return getDirection(a.getX(), a.getY(), b.getX(), b.getY()); } /** @@ -159,6 +159,19 @@ public class DirectionUtil implements DirectionCodes return getDirection(Math.atan2(by-ay, bx-ax)); } + /** + * Returns which of the eight compass directions that point + * b lies in from point a as one of the + * {@link DirectionCodes} direction constants. Note: that the + * coordinates supplied are assumed to be logical (screen) rather than + * cartesian coordinates and NORTH is considered to point + * toward the top of the screen. + */ + public static int getDirection (double ax, double ay, double bx, double by) + { + return getDirection(Math.atan2(by-ay, bx-ax)); + } + /** * Returns which of the eight compass directions is associated with * the specified angle theta. Note: that the angle supplied diff --git a/src/java/com/threerings/util/unsafe/Linux/libunsafe.so b/src/java/com/threerings/util/unsafe/Linux/libunsafe.so index 8ab8af64e..671df8a7e 100755 Binary files a/src/java/com/threerings/util/unsafe/Linux/libunsafe.so and b/src/java/com/threerings/util/unsafe/Linux/libunsafe.so differ