Skip to content

Commit

Permalink
Fixed order of rotations in VS teleport command
Browse files Browse the repository at this point in the history
  • Loading branch information
StewStrong committed Nov 27, 2023
1 parent e1d14c6 commit e59ff2a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down

0 comments on commit e59ff2a

Please sign in to comment.