MeshRendererComponent

MeshRendererComponent

Defines the appearance of a mesh, through materials. Using several materials results in multi-pass rendering.

Constructor

new MeshRendererComponent()

Members

castShadows :boolean

Default Value:
  • true

cullMode :string

Culling mode. Other valid values: 'Never'

Default Value:
  • Dynamic

hidden :boolean

isPickable :boolean

Default Value:
  • true

isReflectable :boolean

Default Value:
  • true

materials :Array.<Material>

Materials to use when rendering

receiveShadows :boolean

Default Value:
  • true

receivesReflections :boolean

worldBound :BoundingVolume

Worldspace bounding considering entity transformations

Methods

clone(optionsopt) → {MeshRendererComponent}

Returns a clone of this mesh renderer component

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
shareMaterials boolean <optional>
false

Cloning this component clones the materials by default

ensureCanReplaceComponent(sourceEntity)

Validate if the entity contains this MeshRenderComponent can be replaced

Parameters:
Name Type Description
sourceEntity Entity

getFrustumPickResult(entity, view) → {string}

Default frustum picking behavior for entities with MeshRendererComponents

Parameters:
Name Type Description
entity

the entity to be picked or not

view

the view containing the frustum to check against

getRayPickResult(entity, ray) → {Object}

Default ray picking behavior for entities with MeshRendererComponents

Parameters:
Name Type Description
entity

the entity to be picked or not

ray

the view containing the frustum to check against

updateBounds(bounding, transform)

Update world bounding

Parameters:
Name Type Description
bounding BoundingVolume

Bounding volume in local space

transform Transform

Transform to apply to local bounding -> world bounding