mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- Apply viewpoint roll
This commit is contained in:
parent
6d43c5cdc6
commit
a120a4657e
2 changed files with 3 additions and 0 deletions
|
@ -209,6 +209,7 @@ void PolyRenderer::SetupPerspectiveMatrix()
|
||||||
float fovy = (float)(2 * DAngle::ToDegrees(atan(tan(Viewpoint.FieldOfView.Radians() / 2) / fovratio)).Degrees);
|
float fovy = (float)(2 * DAngle::ToDegrees(atan(tan(Viewpoint.FieldOfView.Radians() / 2) / fovratio)).Degrees);
|
||||||
|
|
||||||
WorldToView =
|
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(adjustedPitch, 1.0f, 0.0f, 0.0f) *
|
||||||
TriMatrix::rotate(adjustedViewAngle, 0.0f, -1.0f, 0.0f) *
|
TriMatrix::rotate(adjustedViewAngle, 0.0f, -1.0f, 0.0f) *
|
||||||
TriMatrix::scale(1.0f, level.info->pixelstretch, 1.0f) *
|
TriMatrix::scale(1.0f, level.info->pixelstretch, 1.0f) *
|
||||||
|
|
|
@ -59,6 +59,7 @@ void PolyDrawSectorPortal::Render(int portalDepth)
|
||||||
float fovratio = (viewwindow.WidescreenRatio >= 1.3f) ? 1.333333f : ratio;
|
float fovratio = (viewwindow.WidescreenRatio >= 1.3f) ? 1.333333f : ratio;
|
||||||
float fovy = (float)(2 * DAngle::ToDegrees(atan(tan(viewpoint.FieldOfView.Radians() / 2) / fovratio)).Degrees);
|
float fovy = (float)(2 * DAngle::ToDegrees(atan(tan(viewpoint.FieldOfView.Radians() / 2) / fovratio)).Degrees);
|
||||||
TriMatrix worldToView =
|
TriMatrix 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(adjustedPitch, 1.0f, 0.0f, 0.0f) *
|
||||||
TriMatrix::rotate(adjustedViewAngle, 0.0f, -1.0f, 0.0f) *
|
TriMatrix::rotate(adjustedViewAngle, 0.0f, -1.0f, 0.0f) *
|
||||||
TriMatrix::scale(1.0f, level.info->pixelstretch, 1.0f) *
|
TriMatrix::scale(1.0f, level.info->pixelstretch, 1.0f) *
|
||||||
|
@ -169,6 +170,7 @@ void PolyDrawLinePortal::Render(int portalDepth)
|
||||||
float fovratio = (viewwindow.WidescreenRatio >= 1.3f) ? 1.333333f : ratio;
|
float fovratio = (viewwindow.WidescreenRatio >= 1.3f) ? 1.333333f : ratio;
|
||||||
float fovy = (float)(2 * DAngle::ToDegrees(atan(tan(viewpoint.FieldOfView.Radians() / 2) / fovratio)).Degrees);
|
float fovy = (float)(2 * DAngle::ToDegrees(atan(tan(viewpoint.FieldOfView.Radians() / 2) / fovratio)).Degrees);
|
||||||
TriMatrix worldToView =
|
TriMatrix 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(adjustedPitch, 1.0f, 0.0f, 0.0f) *
|
||||||
TriMatrix::rotate(adjustedViewAngle, 0.0f, -1.0f, 0.0f) *
|
TriMatrix::rotate(adjustedViewAngle, 0.0f, -1.0f, 0.0f) *
|
||||||
TriMatrix::scale(1.0f, level.info->pixelstretch, 1.0f) *
|
TriMatrix::scale(1.0f, level.info->pixelstretch, 1.0f) *
|
||||||
|
|
Loading…
Reference in a new issue