Skip to main content

PointEdge

A struct in Root.Township, Alta.Forests.

A 2D point in forest generation with its nearest path edge, worked out lazily and cached.

Fields​

MemberWhat it is
float edgeDistanceCached distance to the nearest edge.
float edgeProgressCached progress along the nearest edge.
Edge nearestEdgeCached nearest edge. Null until worked out.
Vector2 pointThe point, as world x and z.

Methods​

MemberWhat it is
static void EvaluateEdge(ForestGeneration forest, Vector2 point, out Edge nearestEdge, out float distance, out float progress)Finds the nearest path edge, the distance to it and progress along it. Distance is 0 if the point is in open space.
Edge GetEdge(ForestGeneration forest)The nearest edge, working it out on first use.
float GetEdgeDistance(ForestGeneration forest)Distance to the nearest edge, working it out on first use.

Used in​

Members of other types that take, return or hold a PointEdge: