Closed ajantaju closed 4 years ago
I fixed this exact same issue in QuestZDoom recently; hopefully the same fix can more or less be applied here.. it is related to the use of the pixelstretch in the Y-axis scale of the weapon matrix.
The fix (in gl_oculusquest.cpp in my repo, which is currently private until I release QuestZDoom) is to apply a scaling factor to the weapon matrix after it has be translated positionally, but before the rotations have been applied to it:
mat->translate(-weaponoffset[0], (hmdPosition[1] + weaponoffset[1] + vr_height_adjust) / pixelstretch, weaponoffset[2]);
//This is the fix
mat->scale(1, 1 / pixelstretch, 1);
mat->rotate(-90 + (doomYaw - hmdorientation[YAW]) + weaponangles[YAW], 0, 1, 0);
mat->rotate(-weaponangles[PITCH], 1, 0, 0);
mat->rotate(-weaponangles[ROLL], 0, 0, 1);
I appreciate my code probably differs quite a bit of the gz3doom code, but I am sure there's a way this could be applied.
Actually, had a quick look, and I think if you did the following, it might sort it (but i can't test, so could be wrong):
In the method: OpenVRMode::GetHandTransform
mat->translate(pos.X, pos.Z, pos.Y);
//This is the changed line
mat->scale(vr_vunits_per_meter, vr_vunits_per_meter / pixelstretch, -vr_vunits_per_meter);
mat->rotate(-deltaYawDegrees - 180, 0, 1, 0);
I hope that helps!
Hi, thanks for a tip, it really helped. BTW congratulations with a release, it is so much polished, I had great fun playing it. I hope you don't mind that I backported here some things e.g haptics. I put your credits in README.
Hey!, Glad to hear it really helped!, and as for backporting stuff, that's excellent!!, really quite pleased to hear that, it's what this is all about really, thanks for the credits :) Feel free to grab anything else if you see anything that could be of use
Easiest way to see if is hold a Brutal Doom VR Model Grenade up in front of you, then rotate it 90 degrees anti-clockwise, looks squashed.