Moved scale back to be after pitch - otherwise the the bullets don't end up where you point

This commit is contained in:
Magnus Norddahl 2016-11-17 21:19:50 +01:00
parent eac9367ace
commit 6be80efa51

View file

@ -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;
}