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

Method UpdateSpotPointer

ogsr_engine/xrGame/map_location.cpp:477–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477void CMapLocation::UpdateSpotPointer(CUICustomMap* map, CMapSpotPointer* sp, const Fvector2& position_on_map)
478{
479 if (sp->GetParent())
480 return; // already is child
481 float heading;
482 Fvector2 pointer_pos;
483
484 if (map->GetPointerTo(position_on_map, sp->GetWidth() / 2, pointer_pos, heading))
485 {
486 sp->SetWndPos(pointer_pos);
487 sp->SetHeading(heading);
488
489 Frect clip_rect = map->GetClipperRect();
490 sp->SetClipRect(clip_rect);
491
492 map->AttachChild(sp);
493
494 Fvector2 t = position_on_map;
495 Fvector target;
496 target.set(t.x, 0.0f, t.y);
497
498 Fvector s = Level().CurrentEntity()->Position();
499 Fvector source;
500 source.set(s.x, 0.0f, s.z);
501
502 float dist_to_target = source.distance_to(target);
503 map->SetPointerDistance(dist_to_target);
504
505 // Msg("m_position_on_map x=%f y=%f", m_position_on_map.x, m_position_on_map.y);
506 // Msg("t x=%f y=%f", t.x, t.y);
507 // Msg("CurrentEntity()->Position() x=%f y=%f z=%f", Level().CurrentEntity()->Position().x, Level().CurrentEntity()->Position().y, Level().CurrentEntity()->Position().z);
508 // Msg("dist_to_target = %f", dist_to_target);
509 }
510}
511
512void CMapLocation::UpdateMiniMap(CUICustomMap* map)
513{

Callers

nothing calls this directly

Calls 11

GetPointerToMethod · 0.80
GetWidthMethod · 0.80
SetHeadingMethod · 0.80
GetClipperRectMethod · 0.80
SetClipRectMethod · 0.80
AttachChildMethod · 0.80
PositionMethod · 0.80
SetPointerDistanceMethod · 0.80
SetWndPosMethod · 0.45
setMethod · 0.45
distance_toMethod · 0.45

Tested by

no test coverage detected