MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Draw

Method Draw

ogsr_engine/xrGame/EliteDetector.cpp:125–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void CUIArtefactDetectorElite::Draw()
126{
127 if (!m_wrk_area)
128 return;
129
130 Fmatrix LM;
131 GetUILocatorMatrix(LM);
132
133 UIRender->CacheSetXformWorld(LM);
134
135 CUIWindow::Draw();
136
137 //. Frect r = m_wrk_area->GetWndRect();
138 Fvector2 wrk_sz = m_wrk_area->GetWndSize();
139 Fvector2 rp;
140 m_wrk_area->GetAbsolutePos(rp);
141
142 Fmatrix M, Mc;
143 float h, p;
144 Device.vCameraDirection.getHP(h, p);
145 Mc.setHPB(h, 0, 0);
146 Mc.c.set(Device.vCameraPosition);
147 M.invert(Mc);
148
149 UI()->ScreenFrustumLIT().CreateFromRect(Frect().set(rp.x, rp.y, wrk_sz.x, wrk_sz.y));
150
151 auto it = m_items_to_draw.cbegin();
152 auto it_e = m_items_to_draw.cend();
153 for (; it != it_e; ++it)
154 {
155 Fvector p = (*it).pos;
156 Fvector pt3d;
157 M.transform_tiny(pt3d, p);
158 float kz = wrk_sz.y / m_parent->m_fAfDetectRadius;
159 pt3d.x *= kz;
160 pt3d.z *= kz;
161
162 pt3d.x += wrk_sz.x / 2.0f;
163 pt3d.z -= wrk_sz.y;
164
165 Fvector2 pos;
166 pos.set(pt3d.x, -pt3d.z);
167 pos.sub(rp);
168 if (1 /* r.in(pos)*/)
169 {
170 (*it).pStatic->SetWndPos(pos);
171 (*it).pStatic->Draw();
172 }
173 }
174
175 UI()->ScreenFrustumLIT().Clear();
176}
177
178void CUIArtefactDetectorElite::GetUILocatorMatrix(Fmatrix& _m)
179{

Callers 1

render_item_3d_uiMethod · 0.45

Calls 13

DrawFunction · 0.85
UIFunction · 0.85
GetWndSizeMethod · 0.80
getHPMethod · 0.80
setHPBMethod · 0.80
CreateFromRectMethod · 0.80
transform_tinyMethod · 0.80
CacheSetXformWorldMethod · 0.45
setMethod · 0.45
invertMethod · 0.45
subMethod · 0.45
SetWndPosMethod · 0.45

Tested by

no test coverage detected