}
Polygon2D p1 = this.getAgentShapeInEnvironment(a1.id(), pos1, scale1, angle1);
Polygon2D p2 = this.getAgentShapeInEnvironment(a2.id(), pos2, scale2, angle2);
// Polygons with less than two points.
if (p1.nPoints() < 2 && p2.nPoints() < 2) {
return p1.equals(p2);
}
intersects = p1.intersect(p2);