- Apply viewpoint roll

This commit is contained in:
Magnus Norddahl 2017-11-24 22:03:46 +01:00
commit a120a4657e
2 changed files with 3 additions and 0 deletions

View file

@ -209,6 +209,7 @@ void PolyRenderer::SetupPerspectiveMatrix()
float fovy = (float)(2 * DAngle::ToDegrees(atan(tan(Viewpoint.FieldOfView.Radians() / 2) / fovratio)).Degrees);
WorldToView =
TriMatrix::rotate((float)Viewpoint.Angles.Roll.Radians(), 0.0f, 0.0f, 1.0f) *
TriMatrix::rotate(adjustedPitch, 1.0f, 0.0f, 0.0f) *
TriMatrix::rotate(adjustedViewAngle, 0.0f, -1.0f, 0.0f) *
TriMatrix::scale(1.0f, level.info->pixelstretch, 1.0f) *