| 144 | } |
| 145 | |
| 146 | void MyPosition::RenderMyPosition(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, |
| 147 | ScreenBase const & screen, int zoomLevel, FrameValues const & frameValues) |
| 148 | { |
| 149 | if (m_showAzimuth) |
| 150 | { |
| 151 | CHECK(m_arrow3d != nullptr, ()); |
| 152 | m_arrow3d->SetPosition(m2::PointD(m_position)); |
| 153 | m_arrow3d->SetAzimuth(m_azimuth); |
| 154 | m_arrow3d->Render(context, mng, screen, m_isRoutingMode); |
| 155 | } |
| 156 | else |
| 157 | { |
| 158 | gpu::ShapesProgramParams params; |
| 159 | frameValues.SetTo(params); |
| 160 | TileKey const key = GetTileKeyByPoint(m2::PointD(m_position), ClipTileZoomByMaxDataZoom(zoomLevel)); |
| 161 | math::Matrix<float, 4, 4> mv = key.GetTileBasedModelView(screen); |
| 162 | params.m_modelView = glsl::make_mat4(mv.m_data); |
| 163 | |
| 164 | auto const pos = static_cast<m2::PointF>( |
| 165 | MapShape::ConvertToLocal(m2::PointD(m_position), key.GetGlobalRect().Center(), kShapeCoordScalar)); |
| 166 | params.m_position = glsl::vec3(pos.x, pos.y, dp::depth::kMyPositionMarkDepth); |
| 167 | params.m_azimut = -(m_azimuth + static_cast<float>(screen.GetAngle())); |
| 168 | RenderPart(context, mng, params, MyPositionPoint); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | void MyPosition::CacheAccuracySector(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> mng) |
| 173 | { |
no test coverage detected