for (Building building : map.getWorldObjects(Building.class)) {
for (BuildingPart part : building.getParts()) {
if (!(part.getRoof() instanceof HeightfieldRoof)) return;
HeightfieldRoof roofData = (HeightfieldRoof)part.getRoof();
for (PolygonXZ polygon : roofData.getPolygon().getPolygons()) {
for (VectorXZ v : polygon.getVertices()) {
drawBoxAround(target, v, POLYGON_COLOR, 0.3f);
}
for (LineSegmentXZ s : polygon.getSegments()) {
target.drawLineStrip(POLYGON_COLOR, 1, s.p1.xyz(0), s.p2.xyz(0));
}
}
for (VectorXZ v : roofData.getInnerPoints()) {
drawBoxAround(target, v, INNER_POINT_COLOR, 0.5f);
}
for (LineSegmentXZ s : roofData.getInnerSegments()) {
target.drawLineStrip(INNER_SEGMENT_COLOR, 1, s.p1.xyz(0), s.p2.xyz(0));
}
}