Update DirectionHelper.java

fix exception occur when invalid yaw ( negative value ) given .
This commit is contained in:
furplag
2023-12-28 13:18:04 +09:00
committed by GitHub
parent e85f133bc2
commit 30cba7051c

View File

@@ -113,6 +113,9 @@ public final class DirectionHelper {
* @return <p>A normal vector</p>
*/
public static Vector getCoordinateVectorFromRelativeVector(double right, double down, double out, double yaw) {
//Make sure the yaw is between 0 and 360
yaw = normalizeYaw(yaw);
if (yaw == 0) {
//South
return new Vector(right, -down, out);