UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSceneViewProjectionData Struct Reference

#include <SceneView.h>

+ Inheritance diagram for FSceneViewProjectionData:

Public Member Functions

void SetViewRectangle (const FIntRect &InViewRect)
 
void SetConstrainedViewRectangle (const FIntRect &InViewRect)
 
bool IsValidViewRectangle () const
 
bool IsPerspectiveProjection () const
 
const FIntRectGetViewRect () const
 
const FIntRectGetConstrainedViewRect () const
 
FMatrix ComputeViewProjectionMatrix () const
 
float GetNearPlaneFromProjectionMatrix () const
 
bool UpdateOrthoPlanes (float &NearPlane, float &FarPlane, float HalfOrthoWidth, bool bUseCameraHeightAsViewTarget)
 
ENGINE_API bool UpdateOrthoPlanes (FMinimalViewInfo &MinimalViewInfo)
 
ENGINE_API bool UpdateOrthoPlanes (bool bUseCameraHeightAsViewTarget)
 

Static Public Member Functions

static float GetNearPlaneFromProjectionMatrix (const FMatrix &ProjectionMatrix)
 
static ENGINE_API bool UpdateOrthoPlanes (FSceneViewProjectionData *InOutProjectionData, float &NearPlane, float &FarPlane, float HalfOrthoWidth, bool bUseCameraHeightAsViewTarget)
 

Public Attributes

FVector ViewOrigin = FVector::ZeroVector
 
FMatrix ViewRotationMatrix = FMatrix::Identity
 
FMatrix ProjectionMatrix = FMatrix::Identity
 
FIntRect ViewRect = FIntRect(0,0,0,0)
 
FVector CameraToViewTarget = FVector::ZeroVector
 

Protected Attributes

FIntRect ConstrainedViewRect = FIntRect(0,0,0,0)
 

Member Function Documentation

◆ ComputeViewProjectionMatrix()

FMatrix FSceneViewProjectionData::ComputeViewProjectionMatrix ( ) const
inline

◆ GetConstrainedViewRect()

const FIntRect & FSceneViewProjectionData::GetConstrainedViewRect ( ) const
inline

◆ GetNearPlaneFromProjectionMatrix() [1/2]

float FSceneViewProjectionData::GetNearPlaneFromProjectionMatrix ( ) const
inline

◆ GetNearPlaneFromProjectionMatrix() [2/2]

static float FSceneViewProjectionData::GetNearPlaneFromProjectionMatrix ( const FMatrix ProjectionMatrix)
inlinestatic

◆ GetViewRect()

const FIntRect & FSceneViewProjectionData::GetViewRect ( ) const
inline

◆ IsPerspectiveProjection()

bool FSceneViewProjectionData::IsPerspectiveProjection ( ) const
inline

◆ IsValidViewRectangle()

bool FSceneViewProjectionData::IsValidViewRectangle ( ) const
inline

◆ SetConstrainedViewRectangle()

void FSceneViewProjectionData::SetConstrainedViewRectangle ( const FIntRect InViewRect)
inline

◆ SetViewRectangle()

void FSceneViewProjectionData::SetViewRectangle ( const FIntRect InViewRect)
inline

◆ UpdateOrthoPlanes() [1/4]

bool FSceneViewProjectionData::UpdateOrthoPlanes ( bool  bUseCameraHeightAsViewTarget)

This function takes the existing projection matrix and moves the nearplane + view origin. Separating this step from the near plane calculation logic itself helps avoid applying the NearPlane correctiontwice /makes it easier to read.

◆ UpdateOrthoPlanes() [2/4]

bool FSceneViewProjectionData::UpdateOrthoPlanes ( float NearPlane,
float FarPlane,
float  HalfOrthoWidth,
bool  bUseCameraHeightAsViewTarget 
)
inline

◆ UpdateOrthoPlanes() [3/4]

bool FSceneViewProjectionData::UpdateOrthoPlanes ( FMinimalViewInfo MinimalViewInfo)

◆ UpdateOrthoPlanes() [4/4]

bool FSceneViewProjectionData::UpdateOrthoPlanes ( FSceneViewProjectionData InOutProjectionData,
float NearPlane,
float FarPlane,
float  HalfOrthoWidth,
bool  bUseCameraHeightAsViewTarget 
)
static

Use the height of the camera as a sort of pseudo CameraToViewTarget to remove camera position as much as possible so we minimise the near clip plane distance. Depends on view direction being top down as when we get to a side view, the scale grows much larger and it becomes redundant.

Member Data Documentation

◆ CameraToViewTarget

FVector FSceneViewProjectionData::CameraToViewTarget = FVector::ZeroVector

◆ ConstrainedViewRect

FIntRect FSceneViewProjectionData::ConstrainedViewRect = FIntRect(0,0,0,0)
protected

◆ ProjectionMatrix

FMatrix FSceneViewProjectionData::ProjectionMatrix = FMatrix::Identity

UE projection matrix projects such that clip space Z=1 is the near plane, and Z=0 is the infinite far plane.

◆ ViewOrigin

FVector FSceneViewProjectionData::ViewOrigin = FVector::ZeroVector

The view origin.

◆ ViewRect

FIntRect FSceneViewProjectionData::ViewRect = FIntRect(0,0,0,0)

◆ ViewRotationMatrix

FMatrix FSceneViewProjectionData::ViewRotationMatrix = FMatrix::Identity

Rotation matrix transforming from world space to view space.


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