Skip to main content

ElevationFromPath

A class in Root.Township, the global namespace.

Forest spawn filter that weights points by their height above the nearest path and can pull them towards the path's height.

Constructors​

MemberWhat it is
ElevationFromPath()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

3 private and internal fields
MemberWhat it is
private EdgeType edgeTypeWhich edge types count as path.
private AnimationCurve elevationMultiplierCurve from height above the path to a weight multiplier.
private float lerpHeightHow far (0 to 1) to move the point's height to the path's height.

Methods​

MemberWhat it is
override void Filter(ForestFillCore.Setup setup, ref PointNormal pointNormal, ref float weight)Finds the nearest path edge, scales the weight by the curve at the height difference, and lerps the point's height towards the path.