OpenBarnyard
 
Loading...
Searching...
No Matches
AGlowViewport::GlowObject Class Reference

#include <AGlowViewport.h>

Public Member Functions

 GlowObject ()
 
 ~GlowObject ()=default
 
void Setup (const Toshi::TMatrix44 &a_rcTransform, const Toshi::TRenderContext::VIEWPORTPARAMS &a_rcViewportParams, const Toshi::TRenderContext::PROJECTIONPARAMS &a_rcProjectionParams, Toshi::TRenderContext::CameraMode a_eCameraMode)
 
TBOOL IsEnabled () const
 
TBOOL IsNightLight () const
 

Public Attributes

Toshi::TMatrix44 m_oMVP
 
TINT Unknown1
 
Toshi::TRenderContext::VIEWPORTPARAMS m_oViewportParams
 
Toshi::TRenderContext::PROJECTIONPARAMS m_oProjectionParams
 
Toshi::TRenderContext::CameraMode m_eCameraMode
 
TINT m_iAttachBone
 
Toshi::TSceneObject * m_pSceneObject
 
TINT m_eTransformType
 
Toshi::TFrustum m_oFrustum
 
TBOOL m_bIsNightLight
 
TBOOL m_bEnabled
 
Toshi::TMatrix44 m_oTransform
 
GlowObjectm_pNextObject
 
Toshi::TLightID m_iID
 

Detailed Description

Definition at line 12 of file AGlowViewport.h.

Constructor & Destructor Documentation

◆ GlowObject()

AGlowViewport::GlowObject::GlowObject ( )

Definition at line 215 of file AGlowViewport.cpp.

216{
217 Unknown1 = 0;
219 m_iAttachBone = -1;
221
224
225 TRenderContext::VIEWPORTPARAMS oViewportParams;
226 oViewportParams.fX = 0.0f;
227 oViewportParams.fY = 0.0f;
228 oViewportParams.fMinZ = 0.0f;
229 oViewportParams.fMaxZ = 1.0f;
230 oViewportParams.fWidth = 1.0f;
231 oViewportParams.fHeight = 1.0f;
232
233 TRenderContext::PROJECTIONPARAMS oProjectionParams;
234 oProjectionParams.SetFromFOV(
235 oViewportParams.fWidth,
236 oViewportParams.fHeight,
237 TMath::DegToRad( 45.0f ),
238 0.1f,
239 30.0f
240 );
241
242 Setup( TMatrix44::IDENTITY, oViewportParams, oProjectionParams, TRenderContext::CameraMode_Perspective );
243}
#define TNULL
Definition Typedefs.h:23
#define TTRUE
Definition Typedefs.h:25
TFORCEINLINE constexpr TFLOAT DegToRad(TFLOAT fDeg)
Definition TMathInline.h:64
static constinit TMatrix44 IDENTITY
Definition TMatrix44.h:357
void SetFromFOV(TFLOAT a_fViewportWidth, TFLOAT a_fViewportHeight, TFLOAT a_fFOV, TFLOAT a_fNearPlane, TFLOAT a_fFarPlane)
void Setup(const Toshi::TMatrix44 &a_rcTransform, const Toshi::TRenderContext::VIEWPORTPARAMS &a_rcViewportParams, const Toshi::TRenderContext::PROJECTIONPARAMS &a_rcProjectionParams, Toshi::TRenderContext::CameraMode a_eCameraMode)
Toshi::TMatrix44 m_oTransform
Toshi::TSceneObject * m_pSceneObject

◆ ~GlowObject()

AGlowViewport::GlowObject::~GlowObject ( )
default

Member Function Documentation

◆ IsEnabled()

TBOOL AGlowViewport::GlowObject::IsEnabled ( ) const
inline

Definition at line 25 of file AGlowViewport.h.

25{ return m_bEnabled; }

◆ IsNightLight()

TBOOL AGlowViewport::GlowObject::IsNightLight ( ) const
inline

Definition at line 26 of file AGlowViewport.h.

26{ return m_bIsNightLight; }

◆ Setup()

void AGlowViewport::GlowObject::Setup ( const Toshi::TMatrix44 & a_rcTransform,
const Toshi::TRenderContext::VIEWPORTPARAMS & a_rcViewportParams,
const Toshi::TRenderContext::PROJECTIONPARAMS & a_rcProjectionParams,
Toshi::TRenderContext::CameraMode a_eCameraMode )

Definition at line 245 of file AGlowViewport.cpp.

246{
247 m_oViewportParams = a_rcViewportParams;
248 m_oProjectionParams = a_rcProjectionParams;
249 m_eCameraMode = a_eCameraMode;
250
251 TMatrix44 oProjection;
252 TFrustum oFrustum;
253
254 if ( a_eCameraMode == TRenderContext::CameraMode_Orthographic )
255 {
256 TRenderContext::ComputeOrthographicProjection( oProjection, a_rcViewportParams, a_rcProjectionParams );
257 TRenderContext::ComputeOrthographicFrustum( oFrustum, a_rcViewportParams, a_rcProjectionParams );
258 }
259 else
260 {
261 TRenderContext::ComputePerspectiveProjection( oProjection, a_rcViewportParams, a_rcProjectionParams );
262 TRenderContext::ComputePerspectiveFrustum( oFrustum, a_rcViewportParams, a_rcProjectionParams );
263 }
264
265 TMatrix44 oTransformInverted;
266 oTransformInverted.Invert( a_rcTransform );
267
268 for ( TINT i = 0; i < WORLDPLANE_NUMOF; i++ )
269 {
270 TMatrix44::TransformPlaneOrthogonal( m_oFrustum[ i ], oTransformInverted, oFrustum[ i ] );
271 }
272
273 m_oMVP.Multiply( oProjection, a_rcTransform );
274}
TPlane[WORLDPLANE_NUMOF] TFrustum
@ WORLDPLANE_NUMOF
int TINT
Definition Typedefs.h:7
static void TransformPlaneOrthogonal(TPlane &a_rOutPlane, const TMatrix44 &a_rMatrix, const TPlane &a_rcSourcePlane)
Definition TMatrix44.h:239
TBOOL Invert(const TMatrix44 &a_rRight)
Definition TMatrix44.cpp:88
static void ComputeOrthographicFrustum(TFrustum &a_rcFrustum, const VIEWPORTPARAMS &a_rViewportParams, const PROJECTIONPARAMS &a_rProjParams)
static void ComputeOrthographicProjection(TMatrix44 &a_rOutProjection, const VIEWPORTPARAMS &a_rViewportParams, const PROJECTIONPARAMS &a_rProjParams)
static void ComputePerspectiveProjection(TMatrix44 &a_rOutProjection, const VIEWPORTPARAMS &a_rViewportParams, const PROJECTIONPARAMS &a_rProjParams)
static void ComputePerspectiveFrustum(TFrustum &a_rcFrustum, const VIEWPORTPARAMS &a_rViewportParams, const PROJECTIONPARAMS &a_rProjParams)
Toshi::TFrustum m_oFrustum
Toshi::TMatrix44 m_oMVP
Toshi::TRenderContext::VIEWPORTPARAMS m_oViewportParams
Toshi::TRenderContext::PROJECTIONPARAMS m_oProjectionParams
Toshi::TRenderContext::CameraMode m_eCameraMode

Member Data Documentation

◆ m_bEnabled

TBOOL AGlowViewport::GlowObject::m_bEnabled

Definition at line 39 of file AGlowViewport.h.

◆ m_bIsNightLight

TBOOL AGlowViewport::GlowObject::m_bIsNightLight

Definition at line 38 of file AGlowViewport.h.

◆ m_eCameraMode

Toshi::TRenderContext::CameraMode AGlowViewport::GlowObject::m_eCameraMode

Definition at line 33 of file AGlowViewport.h.

◆ m_eTransformType

TINT AGlowViewport::GlowObject::m_eTransformType

Definition at line 36 of file AGlowViewport.h.

◆ m_iAttachBone

TINT AGlowViewport::GlowObject::m_iAttachBone

Definition at line 34 of file AGlowViewport.h.

◆ m_iID

Toshi::TLightID AGlowViewport::GlowObject::m_iID

Definition at line 42 of file AGlowViewport.h.

◆ m_oFrustum

Toshi::TFrustum AGlowViewport::GlowObject::m_oFrustum

Definition at line 37 of file AGlowViewport.h.

◆ m_oMVP

Toshi::TMatrix44 AGlowViewport::GlowObject::m_oMVP

Definition at line 29 of file AGlowViewport.h.

◆ m_oProjectionParams

Toshi::TRenderContext::PROJECTIONPARAMS AGlowViewport::GlowObject::m_oProjectionParams

Definition at line 32 of file AGlowViewport.h.

◆ m_oTransform

Toshi::TMatrix44 AGlowViewport::GlowObject::m_oTransform

Definition at line 40 of file AGlowViewport.h.

◆ m_oViewportParams

Toshi::TRenderContext::VIEWPORTPARAMS AGlowViewport::GlowObject::m_oViewportParams

Definition at line 31 of file AGlowViewport.h.

◆ m_pNextObject

GlowObject* AGlowViewport::GlowObject::m_pNextObject

Definition at line 41 of file AGlowViewport.h.

◆ m_pSceneObject

Toshi::TSceneObject* AGlowViewport::GlowObject::m_pSceneObject

Definition at line 35 of file AGlowViewport.h.

◆ Unknown1

TINT AGlowViewport::GlowObject::Unknown1

Definition at line 30 of file AGlowViewport.h.


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