2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 12:27:43 +00:00

Camera filter refactor

This commit is contained in:
Jack Andersen
2017-05-31 19:34:24 -10:00
parent a550ce1959
commit ca69a54faf
56 changed files with 1201 additions and 260 deletions

View File

@@ -948,18 +948,19 @@ void CBooRenderer::SetPerspective(float fovy, float aspect, float znear, float z
CGraphics::SetPerspective(fovy, aspect, znear, zfar);
}
zeus::CRectangle CBooRenderer::SetViewportOrtho(bool centered, float znear, float zfar)
std::pair<zeus::CVector2f, zeus::CVector2f>
CBooRenderer::SetViewportOrtho(bool centered, float znear, float zfar)
{
float left = centered ? g_Viewport.x10_halfWidth : 0;
float bottom = centered ? g_Viewport.x14_halfHeight : 0;
float top = centered ? g_Viewport.x14_halfHeight : g_Viewport.xc_height;
float right = centered ? g_Viewport.x10_halfWidth : g_Viewport.x8_width;
float left = centered ? g_Viewport.x0_left - g_Viewport.x10_halfWidth : 0.f;
float bottom = centered ? g_Viewport.x4_top - g_Viewport.x14_halfHeight : 0.f;
float top = centered ? g_Viewport.x0_left + g_Viewport.x14_halfHeight : g_Viewport.xc_height;
float right = centered ? g_Viewport.x4_top + g_Viewport.x10_halfWidth : g_Viewport.x8_width;
CGraphics::SetOrtho(left, right, top, bottom, znear, zfar);
CGraphics::SetViewPointMatrix(zeus::CTransform::Identity());
CGraphics::SetModelMatrix(zeus::CTransform::Identity());
return zeus::CRectangle(left, bottom, right, top);
return {{left, bottom}, {right, top}};
}
void CBooRenderer::SetClippingPlanes(const zeus::CFrustum& frustum)