API Docs for: 0.5.5
Show:

kick.scene.MeshRenderer Class

Renders a Mesh. To create custom renderable objects you should not inherit from this class, but simple create a component with a render() method. If a mesh with sub-meshes, which uses multiple materials, the renderOrder is taken from the first material

Constructor

kick.scene.MeshRenderer

(
  • config
)
final

Parameters:

  • config Object

    configuration

Methods

activated

()

Inherited from kick.scene.Component but overwritten in kick/scene/MeshRenderer.js:42

If no materials are assigned, the ENGINE_MATERIAL_DEFAULT is assigned as material.

deactivated

()

Abstract method called when a component is removed from scene. May be undefined.

render

(
  • engineUniforms
  • [overwriteMaterial]
)

Inherited from kick.scene.Component but overwritten in kick/scene/MeshRenderer.js:155

This method may not be called (the renderer could make the same calls)

Parameters:

toJSON

() JSON

Inherited from kick.scene.Component but overwritten in kick/scene/MeshRenderer.js:182

Returns:

JSON:

update

()

Abstract method called every update. May be undefined.

Properties

aabb

kick.math.Aabb

Defines the axis aligned bounding box used for view frustum culling May be undefined or null.

componentType

String final

Inherited from kick.scene.Component but overwritten in kick/scene/MeshRenderer.js:144

Name of the component type = "meshRenderer".

Example:

 var meshRenderer = gameObject.meshRenderer;

gameObject

kick.scene.GameObject

The gameObject owning the component. Initially undefined. The value is set when the Component object is added to a GameObject

material

kick.material.Material

Shortcut for materials[0]

materias

Array_kick.material.Material

renderOrder

Number

Inherited from kick.scene.Component but overwritten in kick/scene/MeshRenderer.js:61

The renderOrder for materials[0]

scriptPriority

Number

Components with largest priority are invoked first. (optional - default 0). Cannot be modified after creation.

Events

componentUpdated

Fire events when components are updated. May be undefined. Must be defined before adding to gameObject.

Event Payload:

contextLost

Fired when mesh is updated

Event Payload: