Slight adjustment to muzzle position based on whether scoped/two-handed

This commit is contained in:
Simon 2023-03-28 13:52:23 +01:00
parent a73db1ebd4
commit 6bf2956431

View file

@ -463,8 +463,10 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
-vr.hmdorientation[YAW], xy);
}
//If scope is engaged, lift muzzle slightly so that it aligns with the headset
float muzzleLift = (vr.cgzoommode == 2 || vr.cgzoommode == 4) ? 0.12f : 0.0f;
float x = offhandPositionAverage[0] - (vr.hmdposition[0] + xy[0]);
float y = (offhandPositionAverage[1] + 0.12f) - (vr.hmdposition[1]);
float y = (offhandPositionAverage[1] + muzzleLift) - (vr.hmdposition[1]);
float z = offhandPositionAverage[2] - (vr.hmdposition[2] + xy[1]);
float zxDist = length(x, z);