From 6be80efa5194f3472afa6d596652099d6020bc0d Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 17 Nov 2016 21:19:50 +0100 Subject: [PATCH] Moved scale back to be after pitch - otherwise the the bullets don't end up where you point --- src/r_poly.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_poly.cpp b/src/r_poly.cpp index dd2df0ee4..0c05a590a 100644 --- a/src/r_poly.cpp +++ b/src/r_poly.cpp @@ -92,10 +92,10 @@ void RenderPolyScene::SetupPerspectiveMatrix() float fovratio = (WidescreenRatio >= 1.3f) ? 1.333333f : ratio; float fovy = (float)(2 * DAngle::ToDegrees(atan(tan(FieldOfView.Radians() / 2) / fovratio)).Degrees); TriMatrix worldToView = + TriMatrix::scale(1.0f, glset.pixelstretch, 1.0f) * TriMatrix::rotate((float)ViewPitch.Radians(), 1.0f, 0.0f, 0.0f) * TriMatrix::rotate((float)(ViewAngle - 90).Radians(), 0.0f, -1.0f, 0.0f) * TriMatrix::swapYZ() * - TriMatrix::scale(1.0f, 1.0f, glset.pixelstretch) * TriMatrix::translate((float)-ViewPos.X, (float)-ViewPos.Y, (float)-ViewPos.Z); WorldToClip = TriMatrix::perspective(fovy, ratio, 5.0f, 65535.0f) * worldToView; }