@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / GrassComponent
Class: GrassComponent ​
Defined in: components/Foliage.ts:26
Stylised grass on the terrain on the same entity: thousands of blades drawn as instances, swaying in the wind, thinning out with distance and gone past viewDistance. Blades are made around the camera as it moves and dropped behind it, in square chunks, so a huge terrain costs what's near.
Extends ​
Constructors ​
Constructor ​
ts
new GrassComponent(options?): GrassComponent;Defined in: components/Foliage.ts:47
Parameters ​
| Parameter | Type |
|---|---|
options | GrassOptions |
Returns ​
GrassComponent
Overrides ​
Properties ​
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
enabled | boolean | true | - | components/Foliage.ts:27 |
density | number | 6 | Blades per square metre close up. | components/Foliage.ts:29 |
viewDistance | number | 50 | Metres to the last blade drawn. | components/Foliage.ts:31 |
bladeHeight | number | 0.45 | - | components/Foliage.ts:32 |
bladeWidth | number | 0.06 | - | components/Foliage.ts:33 |
heightVariation | number | 0.4 | Up to this much taller or shorter (0-1). | components/Foliage.ts:35 |
baseColor | string | "#2f6b2a" | - | components/Foliage.ts:36 |
tipColor | string | "#a7d65a" | - | components/Foliage.ts:37 |
windStrength | number | 0.12 | How far the tips sway, in metres. | components/Foliage.ts:39 |
windSpeed | number | 1.6 | - | components/Foliage.ts:40 |
mask | FoliageMask | undefined | - | components/Foliage.ts:41 |
chunkSize | number | 16 | Chunk side in metres. | components/Foliage.ts:43 |
seed | number | 3 | - | components/Foliage.ts:44 |
castShadow | boolean | false | - | components/Foliage.ts:45 |

