aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/rosegoldaddons/utils/Rotation.java
diff options
context:
space:
mode:
authorRoseGoldIsntGay <yoavkau@gmail.com>2022-01-27 20:44:16 +0200
committerRoseGoldIsntGay <yoavkau@gmail.com>2022-01-27 20:44:16 +0200
commitf4b58abbda168b01513a5ac2ba2870bc00df7074 (patch)
tree2f237367764c74bba1f912acec1da281a2b74d24 /src/main/java/rosegoldaddons/utils/Rotation.java
parentfdc569f2ab7674d850d25b41519b4e3da244dd00 (diff)
downloadRGA-f4b58abbda168b01513a5ac2ba2870bc00df7074.tar.gz
RGA-f4b58abbda168b01513a5ac2ba2870bc00df7074.tar.bz2
RGA-f4b58abbda168b01513a5ac2ba2870bc00df7074.zip
2.7.0-pre2
Diffstat (limited to 'src/main/java/rosegoldaddons/utils/Rotation.java')
-rw-r--r--src/main/java/rosegoldaddons/utils/Rotation.java44
1 files changed, 44 insertions, 0 deletions
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 + '}';
+ }
+}