XII Release 0.1.0
Loading...
Searching...
No Matches
xiiViewData Struct Reference

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

#include <ViewData.h>

Public Member Functions

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

Public Attributes

xiiRenderTargets m_RenderTargets
 
xiiRenderTargets m_SwapChainRenderTargets
 
xiiGALSwapChainm_pSwapChain
 
xiiRectFloat m_ViewPortRect
 
xiiEnum< xiiViewRenderModem_ViewRenderMode
 
xiiEnum< xiiCameraUsageHintm_CameraUsageHint
 
xiiMat4 m_ViewMatrix [2]
 
xiiMat4 m_InverseViewMatrix [2]
 
xiiMat4 m_ProjectionMatrix [2]
 
xiiMat4 m_InverseProjectionMatrix [2]
 
xiiMat4 m_ViewProjectionMatrix [2]
 
xiiMat4 m_InverseViewProjectionMatrix [2]
 

Detailed Description

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

Member Function Documentation

◆ ComputePickingRay()

XII_ALWAYS_INLINE xiiResult xiiViewData::ComputePickingRay ( float fNormalizedScreenPosX,
float fNormalizedScreenPosY,
xiiVec3 & out_vRayStartPos,
xiiVec3 & out_vRayDir,
xiiCameraEye eye = xiiCameraEye::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, XII_FAILURE is returned.

◆ ComputeScreenSpacePos()

XII_ALWAYS_INLINE xiiResult xiiViewData::ComputeScreenSpacePos ( const xiiVec3 & vWorldPos,
xiiVec3 & out_vScreenPosNormalized,
xiiCameraEye eye = xiiCameraEye::Left ) const
inline

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

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


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