Plasma Engine  2.0
Loading...
Searching...
No Matches
View_inl.h
1
2PL_ALWAYS_INLINE plViewHandle plView::GetHandle() const
3{
4 return plViewHandle(m_InternalId);
5}
6
7PL_ALWAYS_INLINE plStringView plView::GetName() const
8{
9 return m_sName.GetView();
10}
11
12PL_ALWAYS_INLINE plWorld* plView::GetWorld()
13{
14 return m_pWorld;
15}
16
17PL_ALWAYS_INLINE const plWorld* plView::GetWorld() const
18{
19 return m_pWorld;
20}
21
22PL_ALWAYS_INLINE plGALSwapChainHandle plView::GetSwapChain() const
23{
24 return m_Data.m_hSwapChain;
25}
26
27PL_ALWAYS_INLINE const plGALRenderTargets& plView::GetRenderTargets() const
28{
29 return m_Data.m_renderTargets;
30}
31
32PL_ALWAYS_INLINE void plView::SetCamera(plCamera* pCamera)
33{
34 m_pCamera = pCamera;
35}
36
37PL_ALWAYS_INLINE plCamera* plView::GetCamera()
38{
39 return m_pCamera;
40}
41
42PL_ALWAYS_INLINE const plCamera* plView::GetCamera() const
43{
44 return m_pCamera;
45}
46
47PL_ALWAYS_INLINE void plView::SetCullingCamera(const plCamera* pCamera)
48{
49 m_pCullingCamera = pCamera;
50}
51
52PL_ALWAYS_INLINE const plCamera* plView::GetCullingCamera() const
53{
54 return m_pCullingCamera != nullptr ? m_pCullingCamera : m_pCamera;
55}
56
57PL_ALWAYS_INLINE void plView::SetLodCamera(const plCamera* pCamera)
58{
59 m_pLodCamera = pCamera;
60}
61
62PL_ALWAYS_INLINE const plCamera* plView::GetLodCamera() const
63{
64 return m_pLodCamera != nullptr ? m_pLodCamera : m_pCamera;
65}
66
68{
69 return m_Data.m_CameraUsageHint;
70}
71
72PL_ALWAYS_INLINE plEnum<plViewRenderMode> plView::GetViewRenderMode() const
73{
74 return m_Data.m_ViewRenderMode;
75}
76
77PL_ALWAYS_INLINE const plRectFloat& plView::GetViewport() const
78{
79 return m_Data.m_ViewPortRect;
80}
81
82PL_ALWAYS_INLINE const plViewData& plView::GetData() const
83{
84 UpdateCachedMatrices();
85 return m_Data;
86}
87
88PL_FORCE_INLINE bool plView::IsValid() const
89{
90 return m_pWorld != nullptr && m_pRenderPipeline != nullptr && m_pCamera != nullptr && m_Data.m_ViewPortRect.HasNonZeroArea();
91}
92
94{
95 return m_pExtractTask;
96}
97
98PL_FORCE_INLINE plResult plView::ComputePickingRay(float fScreenPosX, float fScreenPosY, plVec3& out_vRayStartPos, plVec3& out_vRayDir) const
99{
100 UpdateCachedMatrices();
101 return m_Data.ComputePickingRay(fScreenPosX, fScreenPosY, out_vRayStartPos, out_vRayDir);
102}
103
104PL_FORCE_INLINE plResult plView::ComputeScreenSpacePos(const plVec3& vPoint, plVec3& out_vScreenPos) const
105{
106 UpdateCachedMatrices();
107 return m_Data.ComputeScreenSpacePos(vPoint, out_vScreenPos);
108}
109
110PL_ALWAYS_INLINE const plMat4& plView::GetProjectionMatrix(plCameraEye eye) const
111{
112 UpdateCachedMatrices();
113 return m_Data.m_ProjectionMatrix[static_cast<int>(eye)];
114}
115
116PL_ALWAYS_INLINE const plMat4& plView::GetInverseProjectionMatrix(plCameraEye eye) const
117{
118 UpdateCachedMatrices();
119 return m_Data.m_InverseProjectionMatrix[static_cast<int>(eye)];
120}
121
122PL_ALWAYS_INLINE const plMat4& plView::GetViewMatrix(plCameraEye eye) const
123{
124 UpdateCachedMatrices();
125 return m_Data.m_ViewMatrix[static_cast<int>(eye)];
126}
127
128PL_ALWAYS_INLINE const plMat4& plView::GetInverseViewMatrix(plCameraEye eye) const
129{
130 UpdateCachedMatrices();
131 return m_Data.m_InverseViewMatrix[static_cast<int>(eye)];
132}
133
134PL_ALWAYS_INLINE const plMat4& plView::GetViewProjectionMatrix(plCameraEye eye) const
135{
136 UpdateCachedMatrices();
137 return m_Data.m_ViewProjectionMatrix[static_cast<int>(eye)];
138}
139
140PL_ALWAYS_INLINE const plMat4& plView::GetInverseViewProjectionMatrix(plCameraEye eye) const
141{
142 UpdateCachedMatrices();
143 return m_Data.m_InverseViewProjectionMatrix[static_cast<int>(eye)];
144}
A camera class that stores the orientation and some basic camera settings.
Definition Camera.h:41
Definition RendererFoundationDLL.h:397
PL_ALWAYS_INLINE plStringView GetView() const
Returns a string view to this string's data.
Definition HashedString.h:128
bool HasNonZeroArea() const
Returns true if the area of the rectangle is non zero.
Definition Rect_inl.h:102
A Shared ptr manages a shared object and destroys that object when no one references it anymore....
Definition SharedPtr.h:10
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Definition Declarations.h:64
const plMat4 & GetInverseViewProjectionMatrix(plCameraEye eye) const
Returns the current inverse view-projection matrix.
Definition View_inl.h:140
const plMat4 & GetViewProjectionMatrix(plCameraEye eye) const
Returns the current view-projection matrix.
Definition View_inl.h:134
const plMat4 & GetInverseProjectionMatrix(plCameraEye eye) const
Returns the current inverse projection matrix.
Definition View_inl.h:116
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 posit...
Definition View_inl.h:98
plEnum< plCameraUsageHint > GetCameraUsageHint() const
Returns the camera usage hint for the view.
Definition View_inl.h:67
const plSharedPtr< plTask > & GetExtractTask()
Returns a task implementation that calls ExtractData on this view.
Definition View_inl.h:93
const plMat4 & GetInverseViewMatrix(plCameraEye eye) const
Returns the current inverse view matrix (inverse camera orientation).
Definition View_inl.h:128
const plMat4 & GetViewMatrix(plCameraEye eye) const
Returns the current view matrix (camera orientation).
Definition View_inl.h:122
const plMat4 & GetProjectionMatrix(plCameraEye eye) const
Returns the current projection matrix.
Definition View_inl.h:110
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition RenderTargetSetup.h:9
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
Holds view data like the viewport, view and projection matrices.
Definition ViewData.h:11
plResult ComputePickingRay(float fScreenPosX, float fScreenPosY, plVec3 &out_vRayStartPos, plVec3 &out_vRayDir, plCameraEye eye=plCameraEye::Left) const
Returns the start position and direction (in world space) of the picking ray through the screen posit...
Definition ViewData.h:60