ForestCliffEvaluator
A class in Root.Township, Alta.Forests.
Forest generation modifier that finds cliffs: chains of normal edges where the height drops by at least cliffMinimum. It records points along them for cliff fills to use.
- Listed in World generation
- Inherits or implements
NodeMapModifier - Nested types
CliffPoint
Constructors
| Member | What it is |
|---|---|
ForestCliffEvaluator() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private float cliffMaximum | Serialized but not used in this class. |
private float cliffMinimum | Smallest height drop across an edge that counts as a cliff. |
private List<ForestCliffEvaluator.CliffPoint> cliffPoints | Backing field for Points. |
private List<List<Path>> cliffs | Backing field for Cliffs. |
private HashSet<Path> currentEvaluation | Paths visited by the current EvaluateCliff walk, to stop loops. |
private HashSet<Edge> evaluated | Edges already added to a cliff. |
private LayerMask layerMask | Terrain layer mask. Set in Awake but not used in this class. |
private float stepX | Spacing between cliff points. |
Properties
| Member | What it is |
|---|---|
List<List<Path>> Cliffs { get; } | Each cliff found, as an ordered list of downhill paths. |
List<ForestCliffEvaluator.CliffPoint> Points { get; } | Points spaced along every cliff, with direction and height. |
Methods
| Member | What it is |
|---|---|
override void Modify(ForestGeneration forest) | Finds every cliff in the forest, then places a CliffPoint every stepX metres along each one. |
3 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Sets the raycast layer mask to Terrain. |
private void EvaluateCliff(ForestGeneration forest, List<Path> cliff, Path first) | Walks round from a steep path to collect the neighbouring steep paths that form one cliff. |
private bool IsLegitimateEdge(ForestGeneration forest, Edge edge) | False for edges touching an entrance node. |
Used in
Members of other types that take, return or hold a ForestCliffEvaluator: