From 7be5be6d2add1e9535f67aaf7f360b9c271cac5f Mon Sep 17 00:00:00 2001 From: wannkunstbeikor <93538252+wannkunstbeikor@users.noreply.github.com> Date: Sun, 17 Sep 2023 09:54:09 +0200 Subject: [PATCH] [Core] Fixed xyz rotations hopefully --- FrostyPlugin/Controls/Editors/FrostyLinearTransformEditor.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/FrostyPlugin/Controls/Editors/FrostyLinearTransformEditor.cs b/FrostyPlugin/Controls/Editors/FrostyLinearTransformEditor.cs index 88fbfbfe3..8d06eac2a 100644 --- a/FrostyPlugin/Controls/Editors/FrostyLinearTransformEditor.cs +++ b/FrostyPlugin/Controls/Editors/FrostyLinearTransformEditor.cs @@ -42,12 +42,13 @@ protected override void UpdateValues() { dynamic newVector = TypeLibrary.CreateObject("Vec3"); + /* not needed, since we use xyz instead of ypr now? if (X < -180.0f) X = -180.0f; else if (X > 180.0f) X = 180.0f; if (Y < -180.0f) Y = -180.0f; else if (Y > 180.0f) Y = 180.0f; if (Z < -180.0f) Z = -180.0f; - else if (Z > 180.0f) Z = 180.0f; + else if (Z > 180.0f) Z = 180.0f;*/ newVector.x = X; newVector.y = Y; @@ -139,7 +140,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu // then convert... float val = (float)(Math.PI / 180.0); - Matrix m = Matrix.RotationYawPitchRoll(-obj.Rotation.x * val, obj.Rotation.y * val, obj.Rotation.z * val); + Matrix m = Matrix.RotationX(obj.Rotation.x * val) * Matrix.RotationY(obj.Rotation.y * val) * Matrix.RotationZ(obj.Rotation.z * val); m = m * Matrix.Scaling(obj.Scale.x, obj.Scale.y, obj.Scale.z); trns.trans.x = obj.Translation.x;