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
Parameters:
-
config
Objectconfiguration
Item Index
Methods
Properties
Events
Methods
activated
()
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]
This method may not be called (the renderer could make the same calls)
Parameters:
-
engineUniforms
kick.scene.EngineUniforms -
[overwriteMaterial]
kick.material.Material optional
toJSON
()
JSON
Returns:
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
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
materias
Array_kick.material.Material
renderOrder
Number
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:
-
component
kick.scene.Component