layers/craters/shaping/attributes.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /// @file | ||
| 2 | /// @brief `CraterAttributes`, what a crater looks like in its current state. | ||
| 3 | #pragma once | ||
| 4 | |||
| 5 | #include "terraingen/layers/craters/degradation/state.h" | ||
| 6 | #include "terraingen/layers/craters/generation/population.h" | ||
| 7 | #include "terraingen/layers/craters/profiles/profile.h" | ||
| 8 | |||
| 9 | namespace terraingen { | ||
| 10 | |||
| 11 | /// What a crater looks like in its current state, for listing, labelling or placing. | ||
| 12 | struct CraterAttributes { | ||
| 13 | 29 | double floorDepth = 0.0; ///< Depth of the floor below the surrounding surface (m). | |
| 14 | 29 | double rimHeight = 0.0; ///< Height of the rim crest above the surrounding surface (m). | |
| 15 | 29 | double depthRatio = 0.0; ///< Rim-to-floor depth over diameter now. | |
| 16 | /// The depth ratio now over that when fresh: 1 for a fresh crater, falling as it degrades. | ||
| 17 | 29 | double freshness = 1.0; | |
| 18 | 29 | bool complex = false; ///< Of the complex form: a flat floor and a central peak. | |
| 19 | |||
| 20 | 29 | bool operator==(const CraterAttributes&) const = default; | |
| 21 | }; | ||
| 22 | |||
| 23 | /// The attributes of a crater in `state` (which gives the ratios) shaped by `profile` (the form). | ||
| 24 | /// | ||
| 25 | /// The floor is the profile's lowest point inside the rim and the rim crest its highest from 0.7 | ||
| 26 | /// to 1.3 radii, both sampled every 0.01 radii. | ||
| 27 | CraterAttributes ComputeCraterAttributes(const Crater& crater, const CraterState& state, | ||
| 28 | const CraterProfile& profile); | ||
| 29 | |||
| 30 | } // namespace terraingen | ||
| 31 |