mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
Path Edges
This commit is contained in:
@@ -127,7 +127,7 @@ void ModelRenderer::update_model(const cereal::ModelDataV2::Reader &model, const
|
||||
UIState *s = uiState();
|
||||
path_width *= s->status == STATUS_ENGAGED ? 1.0f : s->status == STATUS_ALWAYS_ON_LATERAL_ACTIVE ? 0.75f : 0.50f;
|
||||
}
|
||||
mapLineToPolygon(model_position, frogpilot_toggles.value("model_ui").toBool() ? path_width : 0.9, path_offset_z, &track_vertices, max_idx, false);
|
||||
mapLineToPolygon(model_position, frogpilot_toggles.value("model_ui").toBool() ? path_width * (1 - (frogpilot_toggles.value("path_edge_width").toDouble() / 100.0f)) : 0.9, path_offset_z, &track_vertices, max_idx, false);
|
||||
|
||||
// FrogPilot variables
|
||||
FrogPilotUIState *fs = frogpilotUIState();
|
||||
@@ -135,6 +135,10 @@ void ModelRenderer::update_model(const cereal::ModelDataV2::Reader &model, const
|
||||
|
||||
const cereal::FrogPilotPlan::Reader &frogpilotPlan = fpsm["frogpilotPlan"].getFrogpilotPlan();
|
||||
|
||||
frogpilot_nvg->track_vertices = track_vertices;
|
||||
|
||||
mapLineToPolygon(model_position, frogpilot_toggles.value("model_ui").toBool() ? path_width : 0, path_offset_z, &frogpilot_nvg->track_edge_vertices, max_idx, false);
|
||||
|
||||
mapAveragedLineToPolygon(lane_lines[0], lane_lines[1], frogpilotPlan.getLaneWidthLeft() / 2.0f, 0, &frogpilot_nvg->track_adjacent_vertices[0], max_idx, height, false);
|
||||
mapAveragedLineToPolygon(lane_lines[2], lane_lines[3], frogpilotPlan.getLaneWidthRight() / 2.0f, 0, &frogpilot_nvg->track_adjacent_vertices[1], max_idx, height, false);
|
||||
}
|
||||
@@ -207,6 +211,8 @@ void ModelRenderer::drawPath(QPainter &painter, const cereal::ModelDataV2::Reade
|
||||
} else if (frogpilot_toggles.value("blind_spot_path").toBool()) {
|
||||
frogpilot_nvg->paintBlindSpotPath(painter);
|
||||
}
|
||||
|
||||
frogpilot_nvg->paintPathEdges(painter, height);
|
||||
}
|
||||
|
||||
void ModelRenderer::updatePathGradient(QLinearGradient &bg) {
|
||||
|
||||
Reference in New Issue
Block a user