Skip to content

Commit

Permalink
Make sure weapon yaw correction is applied in the right direction for…
Browse files Browse the repository at this point in the history
… dual pistols
  • Loading branch information
fholger committed Jan 28, 2025
1 parent 0a384f2 commit c8cc33b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Code/VR/OpenXRInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c8cc33b

Please sign in to comment.