|
|
@ -177,10 +177,11 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) { |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < max_len; ++i) { |
|
|
|
for (int i = 0; i < max_len; ++i) { |
|
|
|
// Some points are out of frame
|
|
|
|
// Some points are out of frame
|
|
|
|
if (scene.track_vertices[i].y() < 0 || scene.track_vertices[i].y() > height()) continue; |
|
|
|
int track_idx = (scene.track_vertices.length() / 2) - i; // flip idx to start from top
|
|
|
|
|
|
|
|
if (scene.track_vertices[track_idx].y() < 0 || scene.track_vertices[track_idx].y() > height()) continue; |
|
|
|
|
|
|
|
|
|
|
|
// Flip so 0 is bottom of frame
|
|
|
|
// Flip so 0 is bottom of frame
|
|
|
|
float lin_grad_point = (height() - scene.track_vertices[i].y()) / height(); |
|
|
|
float lin_grad_point = (height() - scene.track_vertices[track_idx].y()) / height(); |
|
|
|
|
|
|
|
|
|
|
|
// speed up: 120, slow down: 0
|
|
|
|
// speed up: 120, slow down: 0
|
|
|
|
float path_hue = fmax(fmin(60 + acceleration[i] * 35, 120), 0); |
|
|
|
float path_hue = fmax(fmin(60 + acceleration[i] * 35, 120), 0); |
|
|
|