OpenBarnyard
 
Loading...
Searching...
No Matches
TRenderContext::PROJECTIONPARAMS Struct Reference

#include <TRenderContext.h>

Public Member Functions

void SetFromFOV (TFLOAT a_fViewportWidth, TFLOAT a_fViewportHeight, TFLOAT a_fFOV, TFLOAT a_fNearPlane, TFLOAT a_fFarPlane)
 

Public Attributes

TVector2 m_Centre
 
TVector2 m_Proj
 
TFLOAT m_fNearClip
 
TFLOAT m_fFarClip
 

Detailed Description

Definition at line 75 of file TRenderContext.h.

Member Function Documentation

◆ SetFromFOV()

void TRenderContext::PROJECTIONPARAMS::SetFromFOV ( TFLOAT a_fViewportWidth,
TFLOAT a_fViewportHeight,
TFLOAT a_fFOV,
TFLOAT a_fNearPlane,
TFLOAT a_fFarPlane )

Definition at line 360 of file TRenderContext.cpp.

361{
362 TFLOAT fHalfWidth = a_fViewportWidth * 0.5f;
363 TFLOAT fHalfHeight = a_fViewportHeight * 0.5f;
364 TFLOAT fProj = fHalfHeight / TMath::Tan( a_fFOV );
365
366 m_fNearClip = a_fNearPlane;
367 m_fFarClip = a_fFarPlane;
368 m_Centre.x = fHalfWidth;
369 m_Centre.y = fHalfHeight;
370 m_Proj.x = fProj;
371 m_Proj.y = fProj;
372}
float TFLOAT
Definition Typedefs.h:4
TFORCEINLINE TFLOAT Tan(TFLOAT fVal)
Definition TMathInline.h:44

Member Data Documentation

◆ m_Centre

TVector2 TRenderContext::PROJECTIONPARAMS::m_Centre

Definition at line 77 of file TRenderContext.h.

◆ m_fFarClip

TFLOAT TRenderContext::PROJECTIONPARAMS::m_fFarClip

Definition at line 80 of file TRenderContext.h.

◆ m_fNearClip

TFLOAT TRenderContext::PROJECTIONPARAMS::m_fNearClip

Definition at line 79 of file TRenderContext.h.

◆ m_Proj

TVector2 TRenderContext::PROJECTIONPARAMS::m_Proj

Definition at line 78 of file TRenderContext.h.


The documentation for this struct was generated from the following files: