Skip to content

@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 ​

ParameterType
optionsGrassOptions

Returns ​

GrassComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDefault valueDescriptionDefined in
enabledbooleantrue-components/Foliage.ts:27
densitynumber6Blades per square metre close up.components/Foliage.ts:29
viewDistancenumber50Metres to the last blade drawn.components/Foliage.ts:31
bladeHeightnumber0.45-components/Foliage.ts:32
bladeWidthnumber0.06-components/Foliage.ts:33
heightVariationnumber0.4Up to this much taller or shorter (0-1).components/Foliage.ts:35
baseColorstring"#2f6b2a"-components/Foliage.ts:36
tipColorstring"#a7d65a"-components/Foliage.ts:37
windStrengthnumber0.12How far the tips sway, in metres.components/Foliage.ts:39
windSpeednumber1.6-components/Foliage.ts:40
maskFoliageMaskundefined-components/Foliage.ts:41
chunkSizenumber16Chunk side in metres.components/Foliage.ts:43
seednumber3-components/Foliage.ts:44
castShadowbooleanfalse-components/Foliage.ts:45