Commit e6a2a79c authored by VAN TOLL Wouter's avatar VAN TOLL Wouter
Browse files

GUI can now visualize ORCA lines of the selected agent.

parent 12eefed1
......@@ -539,6 +539,17 @@ void UMANSOpenGLWidget::drawAgentCostCircle(Agent& agent)
addContourToBuffer(approximateDisk_Outline(
agentPos + agent.getPolicy()->ComputeNewVelocity(&agent, world), 0.1f),
QColor(255, 255, 255), Target_Agents_Contours, Depth_Agents + 0.2);
// - draw ORCA lines, if they exist
const auto& orcaSolution = agent.GetOrcaSolution();
for (const auto& line : orcaSolution.orcaLines)
{
Vector2D dir = line.direction.getnormalized();
Vector2D drawLinePoint = agentPos + line.point;
addPointsToBuffer({ { drawLinePoint - 5 * dir } }, QColor(0, 0, 0), Target_Agents_Contours, Depth_Agents + 0.2);
addPointsToBuffer({ { drawLinePoint + 5 * dir } }, QColor(200, 200, 200), Target_Agents_Contours, Depth_Agents + 0.2);
}
}
void UMANSOpenGLWidget::drawEnvironment(const bool refresh)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment