From c8cc33b13136ec017e9e250259a99d16ce597a71 Mon Sep 17 00:00:00 2001 From: Holger Frydrych Date: Tue, 28 Jan 2025 20:57:04 +0100 Subject: [PATCH] Make sure weapon yaw correction is applied in the right direction for dual pistols --- Code/VR/OpenXRInput.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/VR/OpenXRInput.cpp b/Code/VR/OpenXRInput.cpp index 6737a0a..8ea297b 100644 --- a/Code/VR/OpenXRInput.cpp +++ b/Code/VR/OpenXRInput.cpp @@ -233,7 +233,8 @@ Matrix34 OpenXRInput::GetControllerWeaponTransform(int hand) { // Weapon bones are offset to what our grip pose is, so we need to rotate the pose a bit Matrix33 correction = Matrix33::CreateRotationX(-gf_PI/2) * Matrix33::CreateRotationY(-gf_PI/2); - Matrix33 gripAngleAdjust = Matrix33::CreateRotationX(DEG2RAD(g_pGameCVars->vr_weapon_pitch_offset)) * Matrix33::CreateRotationZ(DEG2RAD(g_pGameCVars->vr_weapon_yaw_offset)); + int dir = hand == 1 ? 1 : -1; + Matrix33 gripAngleAdjust = Matrix33::CreateRotationX(DEG2RAD(g_pGameCVars->vr_weapon_pitch_offset)) * Matrix33::CreateRotationZ(dir * DEG2RAD(g_pGameCVars->vr_weapon_yaw_offset)); return GetControllerTransform(hand) * gripAngleAdjust * correction; }