ezEngine  Milestone 7
View_inl.h
1 
2 EZ_FORCE_INLINE const char* ezView::GetName() const
3 {
4  return m_sName.GetString().GetData();
5 }
6 
7 EZ_FORCE_INLINE void ezView::SetWorld(ezWorld* pWorld)
8 {
9  m_pWorld = pWorld;
10 }
11 
12 EZ_FORCE_INLINE ezWorld* ezView::GetWorld()
13 {
14  return m_pWorld;
15 }
16 
17 EZ_FORCE_INLINE const ezWorld* ezView::GetWorld() const
18 {
19  return m_pWorld;
20 }
21 
22 EZ_FORCE_INLINE void ezView::SetRenderPipeline(ezUniquePtr<ezRenderPipeline>&& pRenderPipeline)
23 {
24  m_pRenderPipeline = std::move(pRenderPipeline);
25 
26  ezStringBuilder sb = m_sName.GetString();
27  sb.Append(".Render");
28  m_pRenderPipeline->m_RenderProfilingID = ezProfilingSystem::CreateId(sb.GetData());
29 }
30 
31 EZ_FORCE_INLINE ezRenderPipeline* ezView::GetRenderPipeline() const
32 {
33  return m_pRenderPipeline.Borrow();
34 }
35 
36 EZ_FORCE_INLINE void ezView::SetLogicCamera(const ezCamera* pCamera)
37 {
38  m_pLogicCamera = pCamera;
39 }
40 
41 EZ_FORCE_INLINE const ezCamera* ezView::GetLogicCamera() const
42 {
43  return m_pLogicCamera;
44 }
45 
46 EZ_FORCE_INLINE void ezView::SetRenderCamera(const ezCamera* pCamera)
47 {
48  m_pRenderCamera = pCamera;
49 }
50 
51 EZ_FORCE_INLINE const ezCamera* ezView::GetRenderCamera() const
52 {
53  return m_pRenderCamera != nullptr ? m_pRenderCamera : m_pLogicCamera;
54 }
55 
56 EZ_FORCE_INLINE void ezView::SetViewport(const ezRectFloat& viewport)
57 {
58  m_Data.m_ViewPortRect = viewport;
59 }
60 
61 EZ_FORCE_INLINE const ezRectFloat& ezView::GetViewport() const
62 {
63  return m_Data.m_ViewPortRect;
64 }
65 
66 EZ_FORCE_INLINE const ezViewData& ezView::GetData() const
67 {
68  UpdateCachedMatrices();
69  return m_Data;
70 }
71 
72 EZ_FORCE_INLINE bool ezView::IsValid() const
73 {
74  return m_pWorld != nullptr && m_pRenderPipeline != nullptr && m_pLogicCamera != nullptr && m_Data.m_ViewPortRect.HasNonZeroArea();
75 }
76 
77 EZ_FORCE_INLINE ezTask* ezView::GetExtractTask()
78 {
79  return &m_ExtractTask;
80 }
81 
82 EZ_FORCE_INLINE ezResult ezView::ComputePickingRay(float fScreenPosX, float fScreenPosY, ezVec3& out_RayStartPos, ezVec3& out_RayDir)
83 {
84  UpdateCachedMatrices();
85  return m_Data.ComputePickingRay(fScreenPosX, fScreenPosY, out_RayStartPos, out_RayDir);
86 }
87 
88 EZ_FORCE_INLINE const ezMat4& ezView::GetProjectionMatrix() const
89 {
90  UpdateCachedMatrices();
91  return m_Data.m_ProjectionMatrix;
92 }
93 
94 EZ_FORCE_INLINE const ezMat4& ezView::GetInverseProjectionMatrix() const
95 {
96  UpdateCachedMatrices();
97  return m_Data.m_InverseProjectionMatrix;
98 }
99 
100 EZ_FORCE_INLINE const ezMat4& ezView::GetViewMatrix() const
101 {
102  UpdateCachedMatrices();
103  return m_Data.m_ViewMatrix;
104 }
105 
106 EZ_FORCE_INLINE const ezMat4& ezView::GetInverseViewMatrix() const
107 {
108  UpdateCachedMatrices();
109  return m_Data.m_InverseViewMatrix;
110 }
111 
112 EZ_FORCE_INLINE const ezMat4& ezView::GetViewProjectionMatrix() const
113 {
114  UpdateCachedMatrices();
115  return m_Data.m_ViewProjectionMatrix;
116 }
117 
118 EZ_FORCE_INLINE const ezMat4& ezView::GetInverseViewProjectionMatrix() const
119 {
120  UpdateCachedMatrices();
121  return m_Data.m_InverseViewProjectionMatrix;
122 }