Move r_viewport variables into a class
This commit is contained in:
parent
4e45ea2300
commit
e78e76a593
35 changed files with 336 additions and 277 deletions
|
|
@ -146,11 +146,12 @@ TriMatrix TriMatrix::worldToView()
|
|||
|
||||
TriMatrix TriMatrix::viewToClip()
|
||||
{
|
||||
auto viewport = swrenderer::RenderViewport::Instance();
|
||||
float near = 5.0f;
|
||||
float far = 65536.0f;
|
||||
float width = (float)(FocalTangent * near);
|
||||
float top = (float)(swrenderer::CenterY / swrenderer::InvZtoScale * near);
|
||||
float bottom = (float)(top - viewheight / swrenderer::InvZtoScale * near);
|
||||
float top = (float)(viewport->CenterY / viewport->InvZtoScale * near);
|
||||
float bottom = (float)(top - viewheight / viewport->InvZtoScale * near);
|
||||
return frustum(-width, width, bottom, top, near, far);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue