Class: GrassComponent
Hierarchy
MeshRenderer
↳
GrassComponent
Constructors
Properties
- grassMaterial
- grassGeometry
- object3D
- isDestroyed
- receiveShadow
- morphData
- instanceCount
- lodLevel
- alwaysRender
- instanceID
- drawType
- isRenderOrderChange
- needSortOnCameraZ
- isRecievePostEffectUI
Accessors
- nodes
- eventDispatcher
- isStart
- transform
- enable
- geometry
- material
- renderLayer
- rendererMask
- renderOrder
- materials
- castShadow
- castGI
- castReflection
Methods
- init
- setGrass
- setWindNoiseTexture
- setMinMax
- setGrassTexture
- start
- stop
- onUpdate
- onLateUpdate
- onBeforeUpdate
- onGraphic
- onParentChange
- onAddChild
- onRemoveChild
- onEnable
- onDisable
- cloneTo
- copyComponent
- setMorphInfluence
- setMorphInfluenceIndex
- onCompute
- destroy
- attachSceneOctree
- detachSceneOctree
- addMask
- removeMask
- hasMask
- addRendererMask
- removeRendererMask
- selfCloneMaterials
- renderPass
- renderPass2
- recordRenderPass2
- preInit
- beforeDestroy
Constructors
constructor
• new GrassComponent(): GrassComponent
Returns
Overrides
MeshRenderer.constructor
Defined in
packages/geometry/grass/component/GrassComponent.ts:11
Properties
grassMaterial
• grassMaterial: GrassMaterial
Defined in
packages/geometry/grass/component/GrassComponent.ts:8
grassGeometry
• grassGeometry: GrassGeometry
Defined in
packages/geometry/grass/component/GrassComponent.ts:9
object3D
• object3D: Object3D
= null
owner object3D
Inherited from
MeshRenderer.object3D
Defined in
src/components/ComponentBase.ts:17
isDestroyed
• Optional
isDestroyed: boolean
Inherited from
MeshRenderer.isDestroyed
Defined in
src/components/ComponentBase.ts:38
receiveShadow
• receiveShadow: boolean
Enabling this option allows the grid to display any shadows cast on the grid.
Inherited from
MeshRenderer.receiveShadow
Defined in
src/components/renderer/MeshRenderer.ts:23
morphData
• morphData: MorphTargetData
Inherited from
MeshRenderer.morphData
Defined in
src/components/renderer/MeshRenderer.ts:24
instanceCount
• instanceCount: number
= 0
Inherited from
MeshRenderer.instanceCount
Defined in
src/components/renderer/RenderNode.ts:35
lodLevel
• lodLevel: number
= 0
Inherited from
MeshRenderer.lodLevel
Defined in
src/components/renderer/RenderNode.ts:36
alwaysRender
• alwaysRender: boolean
= false
Inherited from
MeshRenderer.alwaysRender
Defined in
src/components/renderer/RenderNode.ts:37
instanceID
• instanceID: string
Inherited from
MeshRenderer.instanceID
Defined in
src/components/renderer/RenderNode.ts:38
drawType
• drawType: number
= 0
Inherited from
MeshRenderer.drawType
Defined in
src/components/renderer/RenderNode.ts:39
isRenderOrderChange
• Optional
isRenderOrderChange: boolean
Inherited from
MeshRenderer.isRenderOrderChange
Defined in
src/components/renderer/RenderNode.ts:55
needSortOnCameraZ
• Optional
needSortOnCameraZ: boolean
Inherited from
MeshRenderer.needSortOnCameraZ
Defined in
src/components/renderer/RenderNode.ts:56
isRecievePostEffectUI
• Optional
isRecievePostEffectUI: boolean
Inherited from
MeshRenderer.isRecievePostEffectUI
Defined in
src/components/renderer/RenderNode.ts:57
Accessors
nodes
• get
nodes(): Transform
[]
Returns
Transform
[]
Defined in
packages/geometry/grass/component/GrassComponent.ts:42
eventDispatcher
• get
eventDispatcher(): CEventDispatcher
Returns
CEventDispatcher
Inherited from
MeshRenderer.eventDispatcher
Defined in
src/components/ComponentBase.ts:23
• set
eventDispatcher(value
): void
Parameters
Name | Type |
---|---|
value | CEventDispatcher |
Returns
void
Inherited from
MeshRenderer.eventDispatcher
Defined in
src/components/ComponentBase.ts:28
isStart
• get
isStart(): boolean
Returns
boolean
Inherited from
MeshRenderer.isStart
Defined in
src/components/ComponentBase.ts:40
transform
• get
transform(): Transform
Return the Transform component attached to the Object3D.
Returns
Transform
Inherited from
MeshRenderer.transform
Defined in
src/components/ComponentBase.ts:47
enable
• get
enable(): boolean
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Returns
boolean
Inherited from
MeshRenderer.enable
Defined in
src/components/ComponentBase.ts:68
• set
enable(value
): void
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
MeshRenderer.enable
Defined in
src/components/ComponentBase.ts:54
geometry
• get
geometry(): GeometryBase
The geometry of the mesh determines its shape
Returns
GeometryBase
Inherited from
MeshRenderer.geometry
Defined in
src/components/renderer/MeshRenderer.ts:53
• set
geometry(value
): void
Parameters
Name | Type |
---|---|
value | GeometryBase |
Returns
void
Inherited from
MeshRenderer.geometry
Defined in
src/components/renderer/MeshRenderer.ts:57
material
• get
material(): Material
material
Returns
Material
Inherited from
MeshRenderer.material
Defined in
src/components/renderer/MeshRenderer.ts:99
• set
material(value
): void
Parameters
Name | Type |
---|---|
value | Material |
Returns
void
Inherited from
MeshRenderer.material
Defined in
src/components/renderer/MeshRenderer.ts:103
renderLayer
• get
renderLayer(): RenderLayer
Returns
RenderLayer
Inherited from
MeshRenderer.renderLayer
Defined in
src/components/renderer/RenderNode.ts:110
• set
renderLayer(value
): void
Parameters
Name | Type |
---|---|
value | RenderLayer |
Returns
void
Inherited from
MeshRenderer.renderLayer
Defined in
src/components/renderer/RenderNode.ts:114
rendererMask
• get
rendererMask(): number
Returns
number
Inherited from
MeshRenderer.rendererMask
Defined in
src/components/renderer/RenderNode.ts:152
• set
rendererMask(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Inherited from
MeshRenderer.rendererMask
Defined in
src/components/renderer/RenderNode.ts:156
renderOrder
• get
renderOrder(): number
Returns
number
Inherited from
MeshRenderer.renderOrder
Defined in
src/components/renderer/RenderNode.ts:160
• set
renderOrder(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Inherited from
MeshRenderer.renderOrder
Defined in
src/components/renderer/RenderNode.ts:164
materials
• get
materials(): Material
[]
Returns
Material
[]
Inherited from
MeshRenderer.materials
Defined in
src/components/renderer/RenderNode.ts:173
• set
materials(value
): void
Parameters
Name | Type |
---|---|
value | Material [] |
Returns
void
Inherited from
MeshRenderer.materials
Defined in
src/components/renderer/RenderNode.ts:177
castShadow
• get
castShadow(): boolean
Returns
boolean
Inherited from
MeshRenderer.castShadow
Defined in
src/components/renderer/RenderNode.ts:345
• set
castShadow(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
MeshRenderer.castShadow
Defined in
src/components/renderer/RenderNode.ts:349
castGI
• get
castGI(): boolean
Returns
boolean
Inherited from
MeshRenderer.castGI
Defined in
src/components/renderer/RenderNode.ts:354
• set
castGI(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
MeshRenderer.castGI
Defined in
src/components/renderer/RenderNode.ts:358
castReflection
• get
castReflection(): boolean
Returns
boolean
Inherited from
MeshRenderer.castReflection
Defined in
src/components/renderer/RenderNode.ts:362
• set
castReflection(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
MeshRenderer.castReflection
Defined in
src/components/renderer/RenderNode.ts:366
Methods
init
▸ init(param?
): void
Parameters
Name | Type |
---|---|
param? | any |
Returns
void
Overrides
MeshRenderer.init
Defined in
packages/geometry/grass/component/GrassComponent.ts:17
setGrass
▸ setGrass(grassWidth
, grassHeight
, segment
, density
, count?
): void
Parameters
Name | Type | Default value |
---|---|---|
grassWidth | number | undefined |
grassHeight | number | undefined |
segment | number | undefined |
density | number | undefined |
count | number | 1000 |
Returns
void
Defined in
packages/geometry/grass/component/GrassComponent.ts:21
setWindNoiseTexture
▸ setWindNoiseTexture(gustNoiseTexture
): void
Parameters
Name | Type |
---|---|
gustNoiseTexture | Texture |
Returns
void
Defined in
packages/geometry/grass/component/GrassComponent.ts:28
setMinMax
▸ setMinMax(min
, max
): void
Parameters
Name | Type |
---|---|
min | Vector3 |
max | Vector3 |
Returns
void
Defined in
packages/geometry/grass/component/GrassComponent.ts:33
setGrassTexture
▸ setGrassTexture(grassTexture
): void
Parameters
Name | Type |
---|---|
grassTexture | Texture |
Returns
void
Defined in
packages/geometry/grass/component/GrassComponent.ts:38
start
▸ start(): void
Returns
void
Inherited from
MeshRenderer.start
Defined in
src/components/ComponentBase.ts:113
stop
▸ stop(): void
Returns
void
Inherited from
MeshRenderer.stop
Defined in
src/components/ComponentBase.ts:114
onUpdate
▸ onUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
MeshRenderer.onUpdate
Defined in
src/components/ComponentBase.ts:117
onLateUpdate
▸ onLateUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
MeshRenderer.onLateUpdate
Defined in
src/components/ComponentBase.ts:118
onBeforeUpdate
▸ onBeforeUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
MeshRenderer.onBeforeUpdate
Defined in
src/components/ComponentBase.ts:119
onGraphic
▸ onGraphic(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
MeshRenderer.onGraphic
Defined in
src/components/ComponentBase.ts:121
onParentChange
▸ onParentChange(lastParent?
, currentParent?
): any
Parameters
Name | Type |
---|---|
lastParent? | Object3D |
currentParent? | Object3D |
Returns
any
Inherited from
MeshRenderer.onParentChange
Defined in
src/components/ComponentBase.ts:122
onAddChild
▸ onAddChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
MeshRenderer.onAddChild
Defined in
src/components/ComponentBase.ts:123
onRemoveChild
▸ onRemoveChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
MeshRenderer.onRemoveChild
Defined in
src/components/ComponentBase.ts:124
onEnable
▸ onEnable(): void
Returns
void
Inherited from
MeshRenderer.onEnable
Defined in
src/components/renderer/MeshRenderer.ts:30
onDisable
▸ onDisable(): void
Returns
void
Inherited from
MeshRenderer.onDisable
Defined in
src/components/renderer/MeshRenderer.ts:34
cloneTo
▸ cloneTo(obj
): void
Parameters
Name | Type |
---|---|
obj | Object3D |
Returns
void
Inherited from
MeshRenderer.cloneTo
Defined in
src/components/renderer/MeshRenderer.ts:38
copyComponent
▸ copyComponent(from
): this
Parameters
Name | Type |
---|---|
from | this |
Returns
this
Inherited from
MeshRenderer.copyComponent
Defined in
src/components/renderer/MeshRenderer.ts:43
setMorphInfluence
▸ setMorphInfluence(key
, value
): void
Set deformation animation parameters
Parameters
Name | Type |
---|---|
key | string |
value | number |
Returns
void
Inherited from
MeshRenderer.setMorphInfluence
Defined in
src/components/renderer/MeshRenderer.ts:110
setMorphInfluenceIndex
▸ setMorphInfluenceIndex(index
, value
): void
Parameters
Name | Type |
---|---|
index | number |
value | number |
Returns
void
Inherited from
MeshRenderer.setMorphInfluenceIndex
Defined in
src/components/renderer/MeshRenderer.ts:119
onCompute
▸ onCompute(view
, command
): void
Parameters
Name | Type |
---|---|
view | View3D |
command | GPUCommandEncoder |
Returns
void
Inherited from
MeshRenderer.onCompute
Defined in
src/components/renderer/MeshRenderer.ts:128
destroy
▸ destroy(force?
): void
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
MeshRenderer.destroy
Defined in
src/components/renderer/MeshRenderer.ts:157
attachSceneOctree
▸ attachSceneOctree(octree
): void
Parameters
Name | Type |
---|---|
octree | Octree |
Returns
void
Inherited from
MeshRenderer.attachSceneOctree
Defined in
src/components/renderer/RenderNode.ts:78
detachSceneOctree
▸ detachSceneOctree(): void
Returns
void
Inherited from
MeshRenderer.detachSceneOctree
Defined in
src/components/renderer/RenderNode.ts:83
addMask
▸ addMask(mask
): void
Parameters
Name | Type |
---|---|
mask | RendererMask |
Returns
void
Inherited from
MeshRenderer.addMask
Defined in
src/components/renderer/RenderNode.ts:140
removeMask
▸ removeMask(mask
): void
Parameters
Name | Type |
---|---|
mask | RendererMask |
Returns
void
Inherited from
MeshRenderer.removeMask
Defined in
src/components/renderer/RenderNode.ts:144
hasMask
▸ hasMask(mask
): boolean
Parameters
Name | Type |
---|---|
mask | RendererMask |
Returns
boolean
Inherited from
MeshRenderer.hasMask
Defined in
src/components/renderer/RenderNode.ts:148
addRendererMask
▸ addRendererMask(tag
): void
Parameters
Name | Type |
---|---|
tag | RendererMask |
Returns
void
Inherited from
MeshRenderer.addRendererMask
Defined in
src/components/renderer/RenderNode.ts:228
removeRendererMask
▸ removeRendererMask(tag
): void
Parameters
Name | Type |
---|---|
tag | RendererMask |
Returns
void
Inherited from
MeshRenderer.removeRendererMask
Defined in
src/components/renderer/RenderNode.ts:232
selfCloneMaterials
▸ selfCloneMaterials(key
): this
Parameters
Name | Type |
---|---|
key | string |
Returns
this
Inherited from
MeshRenderer.selfCloneMaterials
Defined in
src/components/renderer/RenderNode.ts:252
renderPass
▸ renderPass(view
, passType
, renderContext
): void
Parameters
Name | Type |
---|---|
view | View3D |
passType | PassType |
renderContext | RenderContext |
Returns
void
Inherited from
MeshRenderer.renderPass
Defined in
src/components/renderer/RenderNode.ts:370
renderPass2
▸ renderPass2(view
, passType
, rendererPassState
, clusterLightingBuffer
, encoder
, useBundle?
): void
render pass at passType
Parameters
Name | Type | Default value |
---|---|---|
view | View3D | undefined |
passType | PassType | undefined |
rendererPassState | RendererPassState | undefined |
clusterLightingBuffer | ClusterLightingBuffer | undefined |
encoder | GPURenderPassEncoder | undefined |
useBundle | boolean | false |
Returns
void
Inherited from
MeshRenderer.renderPass2
Defined in
src/components/renderer/RenderNode.ts:438
recordRenderPass2
▸ recordRenderPass2(view
, passType
, rendererPassState
, clusterLightingBuffer
, encoder
, useBundle?
): void
Parameters
Name | Type | Default value |
---|---|---|
view | View3D | undefined |
passType | PassType | undefined |
rendererPassState | RendererPassState | undefined |
clusterLightingBuffer | ClusterLightingBuffer | undefined |
encoder | GPURenderPassEncoder | undefined |
useBundle | boolean | false |
Returns
void
Inherited from
MeshRenderer.recordRenderPass2
Defined in
src/components/renderer/RenderNode.ts:486
preInit
▸ preInit(_rendererType
): boolean
Parameters
Name | Type |
---|---|
_rendererType | PassType |
Returns
boolean
Inherited from
MeshRenderer.preInit
Defined in
src/components/renderer/RenderNode.ts:519
beforeDestroy
▸ beforeDestroy(force?
): void
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
MeshRenderer.beforeDestroy