return 0;
}
}
});
}
HomePieceOfFurniture lowestDoorOrWindow = doorsOrWindows.get(0);
// Generate geometry for wall part below window
if (lowestDoorOrWindow.getElevation() > 0) {
wallGeometries.add(createWallVerticalPartGeometry(wall, wallPartPoints, 0,
cosWallYawAngle, sinWallYawAngle, 0, lowestDoorOrWindow.getElevation(), texture,
textureReferencePoint, wallSide));
wallGeometries.add(createWallHorizontalPartGeometry(wallPartPoints, 0, true, roundWall));
wallGeometries.add(createWallHorizontalPartGeometry(wallPartPoints,
lowestDoorOrWindow.getElevation(), false, roundWall));
}
// Generate geometry for wall parts between superimposed windows
for (int i = 0; i < doorsOrWindows.size() - 1; ) {
HomePieceOfFurniture lowerDoorOrWindow = doorsOrWindows.get(i);
HomePieceOfFurniture higherDoorOrWindow = doorsOrWindows.get(++i);
// Ignore higher windows smaller than lower window
while (lowerDoorOrWindow.getElevation() + lowerDoorOrWindow.getHeight() >= higherDoorOrWindow.getElevation() + higherDoorOrWindow.getHeight()
&& ++i < doorsOrWindows.size()) {
higherDoorOrWindow = doorsOrWindows.get(i);
}
if (i < doorsOrWindows.size()
&& lowerDoorOrWindow.getElevation() + lowerDoorOrWindow.getHeight() < higherDoorOrWindow.getElevation()) {
wallGeometries.add(createWallVerticalPartGeometry(wall, wallPartPoints, lowerDoorOrWindow.getElevation() + lowerDoorOrWindow.getHeight(),
cosWallYawAngle, sinWallYawAngle, 0, higherDoorOrWindow.getElevation(), texture, textureReferencePoint, wallSide));
wallGeometries.add(createWallHorizontalPartGeometry(wallPartPoints,
lowerDoorOrWindow.getElevation() + lowerDoorOrWindow.getHeight(), true, roundWall));
wallGeometries.add(createWallHorizontalPartGeometry(wallPartPoints, higherDoorOrWindow.getElevation(), false, roundWall));
}
}
HomePieceOfFurniture highestDoorOrWindow = doorsOrWindows.get(doorsOrWindows.size() - 1);
for (int i = doorsOrWindows.size() - 2; i >= 0; i--) {
HomePieceOfFurniture doorOrWindow = doorsOrWindows.get(i);
if (doorOrWindow.getElevation() + doorOrWindow.getHeight() > highestDoorOrWindow.getElevation() + highestDoorOrWindow.getHeight()) {
highestDoorOrWindow = doorOrWindow;
}
}
float doorOrWindowTop = highestDoorOrWindow.getElevation() + highestDoorOrWindow.getHeight();
// Compute the minimum vertical position of wallPartPoints