From f4b58abbda168b01513a5ac2ba2870bc00df7074 Mon Sep 17 00:00:00 2001 From: RoseGoldIsntGay Date: Thu, 27 Jan 2022 20:44:16 +0200 Subject: 2.7.0-pre2 --- src/main/java/rosegoldaddons/utils/Rotation.java | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/java/rosegoldaddons/utils/Rotation.java (limited to 'src/main/java/rosegoldaddons/utils/Rotation.java') diff --git a/src/main/java/rosegoldaddons/utils/Rotation.java b/src/main/java/rosegoldaddons/utils/Rotation.java new file mode 100644 index 0000000..f18d5ef --- /dev/null +++ b/src/main/java/rosegoldaddons/utils/Rotation.java @@ -0,0 +1,44 @@ +package rosegoldaddons.utils; + + +public class Rotation { + private float yaw; + private float pitch; + + public Rotation(float yaw, float pitch) { + this.yaw = yaw; + this.pitch = pitch; + } + + public float getYaw() { + return this.yaw; + } + + public void setYaw(float yaw) { + this.yaw = yaw; + } + + public float getPitch() { + return this.pitch; + } + + public void setPitch(float pitch) { + this.pitch = pitch; + } + + public void addYaw(float yaw) { + this.yaw += yaw; + } + + public void addPitch(float pitch) { + this.pitch += pitch; + } + + public float getValue() { + return Math.abs(this.yaw) + Math.abs(this.pitch); + } + + public String toString() { + return "Rotation{yaw=" + this.yaw + ", pitch=" + this.pitch + '}'; + } +} -- cgit