Path(ReadOnlySpan<Vector2>, float)
Creates a corridor of a given width along a polyline, such as a road or a river.
Read time 1 minuteLast updated 22 days ago
Definition
- Type: Method
- Namespace: UnityEditor.TerrainTools
- Assembly: UnityEditor
public static TerrainRegion Path(ReadOnlySpan<Vector2> points, float width)
Parameters
The points of the polyline in meters. At least two. The region keeps its own copy.
The full width of the corridor in meters. Must be greater than zero.
Returns
Type | Description |
|---|---|
| TerrainRegion | The new region. |
Remarks
A position belongs to the corridor when it lies closer than half of to any segment of the polyline, so the ends and the bends of the corridor are rounded. Repeated points are allowed.
width