CliffFill
A class in Root.Township, Alta.Forests.
Forest fill step that places objects up the face of cliffs, using the points from a ForestCliffEvaluator. Runs during static chunk generation, mostly off the main thread.
- Listed in World generation
- Inherits or implements
ForestFillCore - Nested types
RaycastRequest - Documented in Forest
Constructors
| Member | What it is |
|---|---|
CliffFill() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
13 private and internal fields
| Member | What it is |
|---|---|
private ForestCliffEvaluator cliffEvaluator | Source of cliff points with their position, height, facing and ray length. |
private int horizontalStep | Uses every Nth cliff point. |
private float horizontalVariation | Random sideways offset along the cliff. |
private bool isBottomAligned | Count rows up from the bottom instead of down from the top. |
private LayerMask layerMask | Layers the cliff raycasts hit. |
private static Logger logger | Logger for this class. |
private float maximumHeight | Highest point on a cliff that gets objects, in metres. |
private float maximumHeightRatio | Highest point as a fraction of the cliff's height. |
private float minimumHeight | Lowest point on a cliff that gets objects, in metres. |
private float minimumHeightRatio | Lowest point as a fraction of the cliff's height. |
private float verticalCutChance | Chance each row is skipped. |
private float verticalSpacing | Metres between rows up the cliff. |
private float verticalVariation | Random up and down offset per row. |
Methods
| Member | What it is |
|---|---|
protected override async Task GenerateInternal(LocationChunk chunk, InstructionSet instructions) | For each cliff point in the chunk, picks heights up the cliff, raycasts into the face on the main thread and adds spawn instructions for hits that pass the fill's modifiers. |
protected virtual IEnumerable Raycasts(Vector3 direction, float distance, CliffFill.RaycastRequest[] raycastRequests, int pointCount, PointNormal[] pointNormals) (iterator) | Main-thread job: casts each request into the cliff along its direction and records the hit point and normal. |