Skip to main content

GrassClumpHolder

A class in Root.Township, Alta.Environmental.Vegetation.

Editor tool that holds generated grass blades and merges them into clump meshes.

Constructors​

MemberWhat it is
GrassClumpHolder()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private List<GrassBlade> bladesBlades held so far.
private float widthHow far from the centre blades are scattered.

Methods​

MemberWhat it is
void Clear(float _width)Sets the scatter width and destroys every blade and child.
Mesh GenerateLOD2()Merges all blades into one mesh cut down to about two triangles each, for a far LOD.
Mesh GenerateTemplate(int maxLevels)Merges all blades into one mesh, trimming each to at most 2 * maxLevels - 1 triangles.
void ReceiveBlade(GrassBladeMesh mesh, Material grassMaterial, bool isUnique)Adds a blade from a blade mesh at a random spot within width (or the centre if unique) with a random turn.
2 private and internal methods
MemberWhat it is
private void OnDestroy()Empty.
private void OnDrawGizmos()Empty.