ezEngine  Release 25.03
ezViewData Struct Reference

Holds view data like the viewport, view and projection matrices. More...

#include <ViewData.h>

Public Member Functions

EZ_ALWAYS_INLINE ezResult ComputePickingRay (float fNormalizedScreenPosX, float fNormalizedScreenPosY, ezVec3 &out_vRayStartPos, ezVec3 &out_vRayDir, ezCameraEye eye=ezCameraEye::Left) const
 Calculates the start position and direction (in world space) of the picking ray through the screen position in this view. More...
 
EZ_ALWAYS_INLINE ezResult ComputeScreenSpacePos (const ezVec3 &vWorldPos, ezVec3 &out_vScreenPosNormalized, ezCameraEye eye=ezCameraEye::Left) const
 Calculates the normalized screen-space coordinate ([0; 1] range) that the given world-space point projects to. More...
 
EZ_ALWAYS_INLINE ezResult ComputeWorldSpacePos (float fNormalizedScreenPosX, float fNormalizedScreenPosY, ezVec3 &out_vWorldPos, ezCameraEye eye=ezCameraEye::Left) const
 Calculates the world-space position that the given normalized screen-space coordinate maps to.
 
EZ_ALWAYS_INLINE void ConvertScreenPixelPosToNormalizedPos (ezVec3 &inout_vPixelPos) const
 Converts a screen-space position from pixel coordinates to normalized coordinates.
 
EZ_ALWAYS_INLINE void ConvertScreenNormalizedPosToPixelPos (ezVec3 &inout_vNormalizedPos) const
 Converts a screen-space position from normalized coordinates to pixel coordinates.
 

Public Attributes

ezGALRenderTargets m_renderTargets
 
ezGALSwapChainHandle m_hSwapChain
 
ezRectFloat m_ViewPortRect
 
ezEnum< ezViewRenderModem_ViewRenderMode
 
ezEnum< ezCameraUsageHintm_CameraUsageHint
 
ezMat4 m_ViewMatrix [2]
 
ezMat4 m_InverseViewMatrix [2]
 
ezMat4 m_ProjectionMatrix [2]
 
ezMat4 m_InverseProjectionMatrix [2]
 
ezMat4 m_ViewProjectionMatrix [2]
 
ezMat4 m_InverseViewProjectionMatrix [2]
 

Detailed Description

Holds view data like the viewport, view and projection matrices.

Member Function Documentation

◆ ComputePickingRay()

EZ_ALWAYS_INLINE ezResult ezViewData::ComputePickingRay ( float  fNormalizedScreenPosX,
float  fNormalizedScreenPosY,
ezVec3 out_vRayStartPos,
ezVec3 out_vRayDir,
ezCameraEye  eye = ezCameraEye::Left 
) const
inline

Calculates the start position and direction (in world space) of the picking ray through the screen position in this view.

fNormalizedScreenPosX and fNormalizedScreenPosY are expected to be in [0; 1] range (normalized screen coordinates). If no ray can be computed, EZ_FAILURE is returned.

◆ ComputeScreenSpacePos()

EZ_ALWAYS_INLINE ezResult ezViewData::ComputeScreenSpacePos ( const ezVec3 vWorldPos,
ezVec3 out_vScreenPosNormalized,
ezCameraEye  eye = ezCameraEye::Left 
) const
inline

Calculates the normalized screen-space coordinate ([0; 1] range) that the given world-space point projects to.

Returns EZ_FAILURE, if the point could not be projected into screen-space.


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