Skip to main content

PointNormal

A struct in Root.Township, Alta.Forests.

A point on the ground with its normal, plus cached info about the nearest forest edge and biome. Passed through forest spawning and spawn modifiers.

Constructors​

MemberWhat it is
PointNormal(PointEdge pointEdge, float y, Vector3 normal)Creates a PointNormal from point and normal.
PointNormal(Vector3 point, Vector3 normal)Creates a PointNormal from point and normal.

Fields​

MemberWhat it is
BiomeSphere biomeThe biome sphere this point is in, if one has been set.
float edgeDistanceCached distance to nearestEdge; only valid once the edge is set.
float edgeProgressCached position along nearestEdge (0 to 1).
bool isHitWhether this point came from a valid ground hit. Both constructors set it true.
Edge nearestEdgeCached nearest edge, or null until worked out.
Vector3 normalThe ground normal at the point.
Vector3 pointThe world position.

Methods​

MemberWhat it is
Edge GetEdge(ForestGeneration forest)The nearest forest edge, worked out and cached on first call.
float GetEdgeDistance(ForestGeneration forest)Distance to the nearest forest edge, worked out and cached on first call.

Used in​

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