diff --git a/Unreal/Plugins/PS_Editor/Source/PS_Editor/GameMode/PS_Editor_Pawn.cpp b/Unreal/Plugins/PS_Editor/Source/PS_Editor/GameMode/PS_Editor_Pawn.cpp index e4dc834..06f88b9 100644 --- a/Unreal/Plugins/PS_Editor/Source/PS_Editor/GameMode/PS_Editor_Pawn.cpp +++ b/Unreal/Plugins/PS_Editor/Source/PS_Editor/GameMode/PS_Editor_Pawn.cpp @@ -363,24 +363,9 @@ void APS_Editor_Pawn::HandleLook(const FInputActionValue& Value) DragPC->ProjectWorldLocationToScreen(GizmoDragPlaneOrigin, ScreenStart); DragPC->ProjectWorldLocationToScreen(GizmoDragPlaneOrigin + AxisDir * 100.0f, ScreenEnd); - const float ScreenLen = (ScreenEnd - ScreenStart).Size(); - - // Use perpendicular for DIRECTION (sign), total mouse for SPEED - // This way both X and Y always contribute, no dead zones - float PerpDot = 0.0f; - if (ScreenLen > 1.0f) - { - FVector2D ScreenAxisDir = (ScreenEnd - ScreenStart) / ScreenLen; - FVector2D ScreenPerp(-ScreenAxisDir.Y, ScreenAxisDir.X); - PerpDot = LookInput.X * ScreenPerp.X - LookInput.Y * ScreenPerp.Y; - } - else - { - PerpDot = LookInput.X + LookInput.Y; - } - - const float MouseMagnitude = FMath::Abs(LookInput.X) + FMath::Abs(LookInput.Y); - AngleDelta = -FMath::Sign(PerpDot) * MouseMagnitude * RotationSpeed; + FVector2D ScreenAxisDir = (ScreenEnd - ScreenStart).GetSafeNormal(); + FVector2D ScreenPerp(-ScreenAxisDir.Y, ScreenAxisDir.X); + AngleDelta = -(LookInput.X * ScreenPerp.X - LookInput.Y * ScreenPerp.Y) * RotationSpeed; } GizmoDragAccumulator += AngleDelta;