Path
A class in Root.Township, Alta.Forests.
One direction of an Edge in the forest generator's node graph, with links to the spaces on either side and the next paths around each node. Used during forest generation.
- Listed in World generation
- Inherits or implements
Path<Node, Path> - Derived types
Node,Path - Documented in Forest
Constructors
| Member | What it is |
|---|---|
Path(Edge edge, bool isA) | Creates a Path from edge and isA. |
Properties
| Member | What it is |
|---|---|
Path AntiClockwise { get; internal set; } | The next path anticlockwise around the graph, set by the generator. |
Path Clockwise { get; internal set; } | The next path clockwise around the graph, set by the generator. |
Edge Edge { get; } | The undirected edge this path is one direction of. |
bool IsAB { get; } | True when this path runs from the edge's A node to its B node. |
Space Left { get; internal set; } | The space on this path's left, set by the generator. |
Path Reverse { get; } | The same edge in the other direction. |
Space Right { get; internal set; } | The space on this path's right, set by the generator. |
Methods
| Member | What it is |
|---|---|
void GetAdjacent(out Path fromCC, out Path fromC, out Path toCC, out Path toC) | Finds the nearest neighbouring paths on each side at both the start and end nodes. |
void GetSides(float additionalRadius, out float startLeft, out float endLeft, out float startRight, out float endRight) | Works out where along the path (0 to 1) each side clears the node radii plus extra radius, using the adjacent paths' angles. |
float InsideDot(Path path, Vector2 position, out float angleDot) | For a path sharing a node, dot between the corner's bisector and the direction to a position. Also outputs the corner's dot. |
bool IsInside(Path path, Vector2 position, out float angleDot) | Whether a position lies inside the corner this path forms with another path that shares a node. |
Vector3 Lerp3d(float t) | Point along the path in 3D, from start (0) to end (1). |
void ProgressFromAngle(Path path, ref float thisProgress, ref float pathProgress) | Flips the two progress values so both measure from the shared node of the corner. |
2 private and internal methods
Used in
Members of other types that take, return or hold a Path:
Edge.AB, Edge.BA, ForestBridges.GetOverlap, ForestCliffEvaluator.cliffs, ForestCliffEvaluator.Cliffs, ForestCliffEvaluator.currentEvaluation, ForestCliffEvaluator.EvaluateCliff, ForestCliffEvaluator.CliffPoint.cliff, ForestCliffEvaluator.CliffPoint.CliffPoint, LakeGenerator.EvaluateWaterEdge, Space.AB, Space.BC, Space.CA, Space.Paths, Space.Space.