pipeline/features.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "terraingen/pipeline/features.h" | ||
| 2 | |||
| 3 | #include <algorithm> | ||
| 4 | |||
| 5 | namespace terraingen { | ||
| 6 | |||
| 7 | 118 | CraterFeatures PlacedCraters(const Terrain& terrain, const RasterGrid& grid, double spacing) { | |
| 8 | 118 | return PlacedCraters(terrain.layers, grid, std::max(spacing, grid.Spacing(terrain.surface))); | |
| 9 | } | ||
| 10 | |||
| 11 | 69 | BoulderFeatures PlacedBoulders(const Terrain& terrain, const RasterGrid& grid, double spacing) { | |
| 12 | 69 | const double resolved = std::max(spacing, grid.Spacing(terrain.surface)); | |
| 13 | 69 | BoulderFeatures placed; | |
| 14 | 224 | for (std::size_t n = 0; n < terrain.layers.size(); ++n) { | |
| 15 | 155 | if (const auto* placer = dynamic_cast<const BoulderPlacer*>(terrain.layers[n].get())) { | |
| 16 | 67 | const TerrainGround ground(terrain, n); | |
| 17 | 67 | placed.Append(placer->BouldersOver(grid, resolved, &ground)); | |
| 18 | 67 | } | |
| 19 | } | ||
| 20 | 69 | return placed; | |
| 21 | } | ||
| 22 | |||
| 23 | } // namespace terraingen | ||
| 24 |