| 123 | } |
| 124 | |
| 125 | void 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 | |
| 178 | void CUIArtefactDetectorElite::GetUILocatorMatrix(Fmatrix& _m) |
| 179 | { |
no test coverage detected