The graphics mesh to instance.
The material to use for this mesh instance.
Optional
node: GraphNodeThe graph node defining the transform for this instance. This parameter is optional when used with RenderComponent and will use the node the component is attached to.
Controls whether the mesh instance can be culled by frustum culling (CameraComponent#frustumCulling).
Use this value to affect rendering order of mesh instances. Only used when mesh instances are added to a Layer with Layer#opaqueSortMode or Layer#transparentSortMode (depending on the material) set to SORTMODE_MANUAL.
The graph node defining the transform for this instance.
Enable rendering for this mesh instance. Use visible property to enable/disable rendering without overhead of removing from scene. But note that the mesh instance is still in the hierarchy and still in the draw call list.
Read this value in Layer#onPostCull to determine if the object is actually going to be rendered.
Static
lightmapThe world space axis-aligned bounding box for this mesh instance.
In some circumstances mesh instances are sorted by a distance calculation to determine their rendering order. Set this callback to override the default distance calculation, which gives the dot product of the camera forward vector and the vector between the camera position and the center of the mesh instance's axis-aligned bounding box. This option can be particularly useful for rendering transparent meshes in a better order than default.
Number of instances when using hardware instancing to render the mesh.
Mask controlling which LightComponents light this mesh instance, which CameraComponent sees it and in which Layer it is rendered. Defaults to 1.
The material used by this mesh instance.
The graphics mesh being instanced.
The morph instance managing morphing of this mesh instance, or null if morphing is not used.
The render style of the mesh instance. Can be:
Defaults to RENDERSTYLE_SOLID.
The skin instance managing skinning of this mesh instance, or null if skinning is not used.
Sets a shader parameter on a mesh instance. Note that this parameter will take precedence over parameter of the same name if set on Material this mesh instance uses for rendering.
The name of the parameter to set.
The value for the specified parameter.
Optional
passFlags: numberMask describing which passes the material should be included in.
Static
_prepare
Create a new MeshInstance instance.
Example