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

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