Skip to main content

AlignWithNormalModifier

A class in Root.Township, the global namespace.

World generation spawn modifier that rotates spawned objects to face along the ground normal, weighted by how flat the ground is.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private bool isUsingYAxisPoints the object's Y axis along the normal instead of its forward axis.
private AnimationCurve normalWeightsCurve from the normal's Y (flatness) to how strongly the rotation is applied.

Methods​

MemberWhat it is
override void Filter(ForestFillCore.Setup setup, ref SpawnParameters point, ref float weight)Rotates the spawn point to look along the normal (or point its Y axis along it), blended by the curve weight.