VisualRadarTracks toggle

This commit is contained in:
royjr
2025-09-23 01:10:44 -04:00
parent e672a352d3
commit ee9fe5c9ed
3 changed files with 18 additions and 8 deletions
+1
View File
@@ -165,6 +165,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"VisualStyle", {PERSISTENT | BACKUP, INT, "0"}}, {"VisualStyle", {PERSISTENT | BACKUP, INT, "0"}},
{"VisualStyleBlend", {PERSISTENT | BACKUP, BOOL, "0"}}, {"VisualStyleBlend", {PERSISTENT | BACKUP, BOOL, "0"}},
{"VisualStyleBlendThreshold", {PERSISTENT | BACKUP, INT, "20"}}, {"VisualStyleBlendThreshold", {PERSISTENT | BACKUP, INT, "20"}},
{"VisualRadarTracks", {PERSISTENT | BACKUP, BOOL, "0"}},
// MADS params // MADS params
{"Mads", {PERSISTENT | BACKUP, BOOL, "1"}}, {"Mads", {PERSISTENT | BACKUP, BOOL, "1"}},
+10 -8
View File
@@ -43,14 +43,16 @@ void ModelRenderer::draw(QPainter &painter, const QRect &surface_rect) {
} }
} }
if (sm.alive("liveTracks") && sm.rcv_frame("liveTracks") >= s->scene.started_frame) { if (QString::fromStdString(Params().get("VisualRadarTracks")).toInt()) {
const auto &tracks = sm["liveTracks"].getLiveTracks().getPoints(); if (sm.alive("liveTracks") && sm.rcv_frame("liveTracks") >= s->scene.started_frame) {
for (const auto &track : tracks) { const auto &tracks = sm["liveTracks"].getLiveTracks().getPoints();
if (!std::isfinite(track.getDRel()) || !std::isfinite(track.getYRel())) continue; for (const auto &track : tracks) {
QPointF screen_pt; if (!std::isfinite(track.getDRel()) || !std::isfinite(track.getYRel())) continue;
if (mapToScreen(track.getDRel(), -track.getYRel(), path_offset_z, &screen_pt)) { QPointF screen_pt;
float radius = std::clamp(15.0f / (1.0f + track.getDRel() * 0.1f), 3.0f, 8.0f); if (mapToScreen(track.getDRel(), -track.getYRel(), path_offset_z, &screen_pt)) {
drawRadarPoint(painter, screen_pt, track.getVRel(), radius * 3); float radius = std::clamp(15.0f / (1.0f + track.getDRel() * 0.1f), 3.0f, 8.0f);
drawRadarPoint(painter, screen_pt, track.getVRel(), radius * 3);
}
} }
} }
} }
@@ -49,6 +49,13 @@ VisualsPanel::VisualsPanel(QWidget *parent) : QWidget(parent) {
"", "",
false, false,
}, },
{
"VisualRadarTracks",
tr("Show Radar Tracks"),
tr("Shows what the cars radar sees."),
"../assets/offroad/icon_monitoring.png",
false,
},
{ {
"VisualStyleBlend", "VisualStyleBlend",
tr("Blend to Overhead Visual Style"), tr("Blend to Overhead Visual Style"),