From 49a400e44a10dfdbccea86a1c76fb94ab2e666bf Mon Sep 17 00:00:00 2001 From: Wesley Wolfe Date: Wed, 11 Dec 2013 03:16:14 -0600 Subject: Add Location.setDirection(Vector). Adds BUKKIT-4862 This commit adds an additional method to Location to set the direction of facing. Included are a set of unit tests that ensure the consistency of getDirection and setDirection using a set of cardinal directions and arbituary data points. Javadocs were also added to pitch and yaw methods that explain the unit and points of origin. --- src/main/java/org/bukkit/Location.java | 95 +++++++++++--- src/test/java/org/bukkit/LocationTest.java | 196 +++++++++++++++++++++++++++++ 2 files changed, 277 insertions(+), 14 deletions(-) create mode 100644 src/test/java/org/bukkit/LocationTest.java (limited to 'src') diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java index e3f362fd..0f74f6d4 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -167,45 +167,79 @@ public class Location implements Cloneable { } /** - * Sets the yaw of this location - * - * @param yaw New yaw + * Sets the yaw of this location, measured in degrees. + * + * Increasing yaw values are the equivalent of turning to your + * right-facing, increasing the scale of the next respective axis, and + * decreasing the scale of the previous axis. + * + * @param yaw new rotation's yaw */ public void setYaw(float yaw) { this.yaw = yaw; } /** - * Gets the yaw of this location + * Gets the yaw of this location, measured in degrees. + * + * Increasing yaw values are the equivalent of turning to your + * right-facing, increasing the scale of the next respective axis, and + * decreasing the scale of the previous axis. * - * @return Yaw + * @return the rotation's yaw */ public float getYaw() { return yaw; } /** - * Sets the pitch of this location + * Sets the pitch of this location, measured in degrees. + *