From e59ff2aa46df6a9c598fae707ddb086d956e2512 Mon Sep 17 00:00:00 2001 From: StewStrong Date: Sun, 26 Nov 2023 21:16:31 -0700 Subject: [PATCH] Fixed order of rotations in VS teleport command --- .../valkyrienskies/mod/common/command/RelativeVector3.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/mod/common/command/RelativeVector3.kt b/common/src/main/kotlin/org/valkyrienskies/mod/common/command/RelativeVector3.kt index f54cdb6d5..b935c2c63 100644 --- a/common/src/main/kotlin/org/valkyrienskies/mod/common/command/RelativeVector3.kt +++ b/common/src/main/kotlin/org/valkyrienskies/mod/common/command/RelativeVector3.kt @@ -6,10 +6,10 @@ import java.lang.Math.toRadians data class RelativeVector3(val x: RelativeValue, val y: RelativeValue, val z: RelativeValue) { fun toEulerRotation(sourcePitchDegrees: Double, sourceYawDegrees: Double, sourceRollDegrees: Double): Quaterniond = - Quaterniond().rotateXYZ( - toRadians(x.getRelativeValue(sourcePitchDegrees)), - toRadians(y.getRelativeValue(sourceYawDegrees)), + Quaterniond().rotateZYX( toRadians(z.getRelativeValue(sourceRollDegrees)), + toRadians(y.getRelativeValue(sourceYawDegrees)), + toRadians(x.getRelativeValue(sourcePitchDegrees)), ) fun toEulerRotationFromMCEntity(mcEntityPitch: Double, mcEntityYaw: Double) =