}
TerrainBoundaryWorldObject terrainBoundary =
(TerrainBoundaryWorldObject)otherWO;
SimplePolygonXZ outlinePolygon = terrainBoundary.getOutlinePolygonXZ();
if (outlinePolygon != null) {
subtractPolys.add(outlinePolygon);
allPolys.add(outlinePolygon);
for (EleConnector eleConnector : otherWO.getEleConnectors()) {
if (!outlinePolygon.getVertexCollection().contains(eleConnector.pos)) {
eleConnectorPoints.add(eleConnector.pos);
}
}
}
} else {
for (EleConnector eleConnector : otherWO.getEleConnectors()) {
if (eleConnector.reference == null) {
/* workaround to avoid using connectors at intersections,
* which might fall on area segments
* //TODO cleaner solution
*/
continue;
}
eleConnectorPoints.add(eleConnector.pos);
}
if (otherWO instanceof WorldObjectWithOutline) {
SimplePolygonXZ outlinePolygon =
((WorldObjectWithOutline)otherWO).getOutlinePolygonXZ();
if (outlinePolygon != null) {
allPolys.add(outlinePolygon);