Plasma Engine  2.0
Loading...
Searching...
No Matches
plView Class Reference

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>

Inheritance diagram for plView:

Public Member Functions

plViewHandle GetHandle () const
 
void SetName (plStringView sName)
 
plStringView GetName () const
 
void SetWorld (plWorld *pWorld)
 
plWorldGetWorld ()
 
const plWorldGetWorld () const
 
void SetSwapChain (plGALSwapChainHandle 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.
 
plGALSwapChainHandle GetSwapChain () const
 
void SetRenderTargets (const plGALRenderTargets &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 plGALRenderTargetsGetRenderTargets () const
 
const plGALRenderTargetsGetActiveRenderTargets () const
 Returns the render targets that were either set via the swapchain or via the manually set render targets.
 
void SetRenderPipelineResource (plRenderPipelineResourceHandle hPipeline)
 
plRenderPipelineResourceHandle GetRenderPipelineResource () const
 
void SetCamera (plCamera *pCamera)
 
plCameraGetCamera ()
 
const plCameraGetCamera () const
 
void SetCullingCamera (const plCamera *pCamera)
 
const plCameraGetCullingCamera () const
 
void SetLodCamera (const plCamera *pCamera)
 
const plCameraGetLodCamera () const
 
plEnum< plCameraUsageHintGetCameraUsageHint () const
 Returns the camera usage hint for the view.
 
void SetCameraUsageHint (plEnum< plCameraUsageHint > 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 (plEnum< plViewRenderMode > value)
 
plEnum< plViewRenderModeGetViewRenderMode () const
 
void SetViewport (const plRectFloat &viewport)
 
const plRectFloatGetViewport () const
 
void ForceUpdate ()
 Forces the render pipeline to be rebuilt.
 
const plViewDataGetData () const
 
bool IsValid () const
 
void ExtractData ()
 Extracts all relevant data from the world to render the view.
 
const plSharedPtr< plTask > & GetExtractTask ()
 Returns a task implementation that calls ExtractData on this view.
 
plResult ComputePickingRay (float fScreenPosX, float fScreenPosY, plVec3 &out_vRayStartPos, plVec3 &out_vRayDir) const
 Returns the start position and direction (in world space) of the picking ray through the screen position in this view.
 
plResult ComputeScreenSpacePos (const plVec3 &vPoint, plVec3 &out_vScreenPos) const
 
const plMat4GetProjectionMatrix (plCameraEye eye) const
 Returns the current projection matrix.
 
const plMat4GetInverseProjectionMatrix (plCameraEye eye) const
 Returns the current inverse projection matrix.
 
const plMat4GetViewMatrix (plCameraEye eye) const
 Returns the current view matrix (camera orientation).
 
const plMat4GetInverseViewMatrix (plCameraEye eye) const
 Returns the current inverse view matrix (inverse camera orientation).
 
const plMat4GetViewProjectionMatrix (plCameraEye eye) const
 Returns the current view-projection matrix.
 
const plMat4GetInverseViewProjectionMatrix (plCameraEye eye) const
 Returns the current inverse view-projection matrix.
 
void ComputeCullingFrustum (plFrustum &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 plVariant &value)
 
void SetExtractorProperty (const char *szPassName, const char *szPropertyName, const plVariant &value)
 
void ResetRenderPassProperties ()
 
void ResetExtractorProperties ()
 
void SetRenderPassReadBackProperty (const char *szPassName, const char *szPropertyName, const plVariant &value)
 
plVariant GetRenderPassReadBackProperty (const char *szPassName, const char *szPropertyName)
 
bool IsRenderPassReadBackPropertyExisting (const char *szPassName, const char *szPropertyName) const
 
void UpdateViewData (plUInt32 uiDataIndex)
 Pushes the view and camera data into the extracted data of the pipeline.
 
- Public Member Functions inherited from plRenderPipelineNode
void InitializePins ()
 
plHashedString GetPinName (const plRenderPipelineNodePin *pPin) const
 
const plRenderPipelineNodePinGetPinByName (const char *szName) const
 
const plRenderPipelineNodePinGetPinByName (plHashedString sName) const
 
const plArrayPtr< const plRenderPipelineNodePin *const > GetInputPins () const
 
const plArrayPtr< const plRenderPipelineNodePin *const > GetOutputPins () const
 
- Public Member Functions inherited from plReflectedClass
virtual const plRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const plRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
PL_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Public Attributes

plTagSet m_IncludeTags
 
plTagSet m_ExcludeTags
 

Friends

class plRenderWorld
 
class plMemoryUtils
 

Additional Inherited Members

- Static Public Member Functions inherited from plNoBase
static const plRTTIGetStaticRTTI ()
 

Detailed Description

Encapsulates a view on the given world through the given camera and rendered with the specified RenderPipeline into the given render target setup.

Member Function Documentation

◆ ComputePickingRay()

PL_FORCE_INLINE plResult plView::ComputePickingRay ( float fScreenPosX,
float fScreenPosY,
plVec3 & out_vRayStartPos,
plVec3 & out_vRayDir ) const

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

fScreenPosX and fScreenPosY are expected to be in [0; 1] range (normalized pixel coordinates). If no ray can be computed, PL_FAILURE is returned.

◆ UpdateViewData()

void plView::UpdateViewData ( plUInt32 uiDataIndex)

Pushes the view and camera data into the extracted data of the pipeline.

Use plRenderWorld::GetDataIndexForExtraction() to update the data from the extraction thread. Can't be used if this view is currently extracted. Use plRenderWorld::GetDataIndexForRendering() to update the data from the render thread.


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