MCPcopy Create free account
hub / github.com/comaps/comaps / RenderMyPosition

Method RenderMyPosition

libs/drape_frontend/my_position.cpp:146–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void 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
172void MyPosition::CacheAccuracySector(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> mng)
173{

Callers 1

RenderMethod · 0.80

Calls 10

GetTileKeyByPointFunction · 0.85
SetToMethod · 0.80
GetTileBasedModelViewMethod · 0.80
SetPositionMethod · 0.45
SetAzimuthMethod · 0.45
RenderMethod · 0.45
CenterMethod · 0.45
GetGlobalRectMethod · 0.45
GetAngleMethod · 0.45

Tested by

no test coverage detected