mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-29 21:33:42 +08:00
overhead
This commit is contained in:
@@ -494,9 +494,14 @@ void ModelRenderer::drawLead(QPainter &painter, const cereal::RadarState::LeadDa
|
||||
|
||||
// Projects a point in car to space to the corresponding point in full frame image space.
|
||||
bool ModelRenderer::mapToScreen(float in_x, float in_y, float in_z, QPointF *out) {
|
||||
Eigen::Vector3f input(in_x, in_y, in_z);
|
||||
auto pt = car_space_transform * input;
|
||||
*out = QPointF(pt.x() / pt.z(), pt.y() / pt.z());
|
||||
if (QString::fromStdString(Params().get("VisualStyle")).toInt() == 3) {
|
||||
constexpr float scale = 20.0f; // meters → pixels, tweak to zoom
|
||||
*out = QPointF(clip_region.center().x() + in_y * scale, clip_region.bottom() - in_x * scale);
|
||||
} else {
|
||||
Eigen::Vector3f input(in_x, in_y, in_z);
|
||||
auto pt = car_space_transform * input;
|
||||
*out = QPointF(pt.x() / pt.z(), pt.y() / pt.z());
|
||||
}
|
||||
return clip_region.contains(*out);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,12 +89,12 @@ VisualsPanel::VisualsPanel(QWidget *parent) : QWidget(parent) {
|
||||
list->addItem(dev_ui_settings);
|
||||
|
||||
// Visuals: Visual Style
|
||||
std::vector<QString> visual_style_settings_texts{tr("Default"), tr("Minimal"), tr("Vision")};
|
||||
std::vector<QString> visual_style_settings_texts{tr("Default"), tr("Minimal"), tr("Vision"), tr("Overhead")};
|
||||
visual_style_settings = new ButtonParamControlSP(
|
||||
"VisualStyle", tr("Visual Style"), tr("Controls how the road and driving environment are displayed in the onroad UI."),
|
||||
"",
|
||||
visual_style_settings_texts,
|
||||
380);
|
||||
250);
|
||||
list->addItem(visual_style_settings);
|
||||
|
||||
sunnypilotScroller = new ScrollViewSP(list, this);
|
||||
|
||||
Reference in New Issue
Block a user