![]() |
ezEngine
Release 25.03
|
Encapsulates a view on the given world through the given camera and rendered with the specified RenderPipeline into the given render target setup. More...
#include <View.h>
Public Member Functions | |
ezViewHandle | GetHandle () const |
void | SetName (ezStringView sName) |
ezStringView | GetName () const |
void | SetWorld (ezWorld *pWorld) |
ezWorld * | GetWorld () |
const ezWorld * | GetWorld () const |
void | SetSwapChain (ezGALSwapChainHandle hSwapChain) |
Sets the swapchain that this view will be rendering into. Can be invalid in case the render target is an off-screen buffer in which case SetRenderTargets needs to be called. Setting the swap-chain is necessary in order to acquire and present the image to the window. SetSwapChain and SetRenderTargets are mutually exclusive. Calling this function will reset the render targets. | |
ezGALSwapChainHandle | GetSwapChain () const |
void | SetRenderTargets (const ezGALRenderTargets &renderTargets) |
Sets the off-screen render targets. Use SetSwapChain if rendering to a window. SetSwapChain and SetRenderTargets are mutually exclusive. Calling this function will reset the swap chain. | |
const ezGALRenderTargets & | GetRenderTargets () const |
const ezGALRenderTargets & | GetActiveRenderTargets () const |
Returns the render targets that were either set via the swapchain or via the manually set render targets. | |
void | SetRenderPipelineResource (ezRenderPipelineResourceHandle hPipeline) |
ezRenderPipelineResourceHandle | GetRenderPipelineResource () const |
void | SetCamera (ezCamera *pCamera) |
ezCamera * | GetCamera () |
const ezCamera * | GetCamera () const |
void | SetCullingCamera (const ezCamera *pCamera) |
const ezCamera * | GetCullingCamera () const |
void | SetLodCamera (const ezCamera *pCamera) |
const ezCamera * | GetLodCamera () const |
ezEnum< ezCameraUsageHint > | GetCameraUsageHint () const |
Returns the camera usage hint for the view. | |
void | SetCameraUsageHint (ezEnum< ezCameraUsageHint > val) |
Sets the camera usage hint for the view. If not 'None', the camera component of the same usage will be auto-connected to this view. | |
void | SetViewRenderMode (ezEnum< ezViewRenderMode > value) |
ezEnum< ezViewRenderMode > | GetViewRenderMode () const |
void | SetViewport (const ezRectFloat &viewport) |
const ezRectFloat & | GetViewport () const |
void | ForceUpdate () |
Forces the render pipeline to be rebuilt. | |
const ezViewData & | GetData () const |
bool | IsValid () const |
void | ExtractData () |
Extracts all relevant data from the world to render the view. | |
const ezSharedPtr< ezTask > & | GetExtractTask () |
Returns a task implementation that calls ExtractData on this view. | |
ezResult | ComputePickingRay (float fNormalizedScreenPosX, float fNormalizedScreenPosY, ezVec3 &out_vRayStartPos, ezVec3 &out_vRayDir) const |
Calculates the start position and direction (in world space) of the picking ray through the screen position in this view. More... | |
ezResult | ComputeScreenSpacePos (const ezVec3 &vWorldPos, ezVec3 &out_vScreenPosNormalized) const |
Calculates the normalized screen-space coordinate ([0; 1] range) that the given world-space point projects to. More... | |
ezResult | ComputeWorldSpacePos (float fNormalizedScreenPosX, float fNormalizedScreenPosY, ezVec3 &out_vWorldPos) const |
Calculates the world-space position that the given normalized screen-space coordinate maps to. | |
void | ConvertScreenPixelPosToNormalizedPos (ezVec3 &inout_vPixelPos) |
Converts a screen-space position from pixel coordinates to normalized coordinates. | |
void | ConvertScreenNormalizedPosToPixelPos (ezVec3 &inout_vNormalizedPos) |
Converts a screen-space position from normalized coordinates to pixel coordinates. | |
const ezMat4 & | GetProjectionMatrix (ezCameraEye eye) const |
Returns the current projection matrix. | |
const ezMat4 & | GetInverseProjectionMatrix (ezCameraEye eye) const |
Returns the current inverse projection matrix. | |
const ezMat4 & | GetViewMatrix (ezCameraEye eye) const |
Returns the current view matrix (camera orientation). | |
const ezMat4 & | GetInverseViewMatrix (ezCameraEye eye) const |
Returns the current inverse view matrix (inverse camera orientation). | |
const ezMat4 & | GetViewProjectionMatrix (ezCameraEye eye) const |
Returns the current view-projection matrix. | |
const ezMat4 & | GetInverseViewProjectionMatrix (ezCameraEye eye) const |
Returns the current inverse view-projection matrix. | |
void | ComputeCullingFrustum (ezFrustum &out_frustum) const |
Returns the frustum that should be used for determine visible objects for this view. | |
void | SetShaderPermutationVariable (const char *szName, const char *szValue) |
void | SetRenderPassProperty (const char *szPassName, const char *szPropertyName, const ezVariant &value) |
void | SetExtractorProperty (const char *szPassName, const char *szPropertyName, const ezVariant &value) |
void | ResetRenderPassProperties () |
void | ResetExtractorProperties () |
void | SetRenderPassReadBackProperty (const char *szPassName, const char *szPropertyName, const ezVariant &value) |
ezVariant | GetRenderPassReadBackProperty (const char *szPassName, const char *szPropertyName) |
bool | IsRenderPassReadBackPropertyExisting (const char *szPassName, const char *szPropertyName) const |
void | UpdateViewData (ezUInt32 uiDataIndex) |
Pushes the view and camera data into the extracted data of the pipeline. More... | |
![]() | |
void | InitializePins () |
ezHashedString | GetPinName (const ezRenderPipelineNodePin *pPin) const |
const ezRenderPipelineNodePin * | GetPinByName (const char *szName) const |
const ezRenderPipelineNodePin * | GetPinByName (ezHashedString sName) const |
const ezArrayPtr< const ezRenderPipelineNodePin *const > | GetInputPins () const |
const ezArrayPtr< const ezRenderPipelineNodePin *const > | GetOutputPins () const |
![]() | |
virtual const ezRTTI * | GetDynamicRTTI () const |
bool | IsInstanceOf (const ezRTTI *pType) const |
Returns whether the type of this instance is of the given type or derived from it. | |
template<typename T > | |
EZ_ALWAYS_INLINE bool | IsInstanceOf () const |
Returns whether the type of this instance is of the given type or derived from it. | |
Public Attributes | |
ezTagSet | m_IncludeTags |
ezTagSet | m_ExcludeTags |
Friends | |
class | ezRenderWorld |
class | ezMemoryUtils |
Additional Inherited Members | |
![]() | |
static const ezRTTI * | GetStaticRTTI () |
Encapsulates a view on the given world through the given camera and rendered with the specified RenderPipeline into the given render target setup.
EZ_FORCE_INLINE ezResult ezView::ComputePickingRay | ( | float | fNormalizedScreenPosX, |
float | fNormalizedScreenPosY, | ||
ezVec3 & | out_vRayStartPos, | ||
ezVec3 & | out_vRayDir | ||
) | const |
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.
EZ_FORCE_INLINE ezResult ezView::ComputeScreenSpacePos | ( | const ezVec3 & | vWorldPos, |
ezVec3 & | out_vScreenPosNormalized | ||
) | const |
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.
void ezView::UpdateViewData | ( | ezUInt32 | uiDataIndex | ) |
Pushes the view and camera data into the extracted data of the pipeline.
Use ezRenderWorld::GetDataIndexForExtraction() to update the data from the extraction thread. Can't be used if this view is currently extracted. Use ezRenderWorld::GetDataIndexForRendering() to update the data from the render thread.