Builder

class Builder(count: Int)

Adds renderable components to entities using a builder pattern.

Parameters

count

the number of primitives that will be supplied to the builder

Constructors

Link copied to clipboard
constructor(count: Int)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Type of geometry for a Renderable.

Link copied to clipboard

Functions

Link copied to clipboard
fun blendOrder(primitiveIndex: Int, blendOrder: Int): RenderableManager.Builder

Sets the drawing order for blended primitives. The drawing order is either global or local (default) to this Renderable. In either case, the Renderable priority takes precedence.

Link copied to clipboard
fun boneIndicesAndWeights(primitiveIndex: Int, indicesAndWeights: FloatArray, count: Int, bonesPerVertex: Int): RenderableManager.Builder

Defines bone indices and weights pairs for vertex skinning, for primitives with more than 4 bones per vertex.

Link copied to clipboard
fun boundingBox(axisAlignedBoundingBox: Box): RenderableManager.Builder

The axis-aligned bounding box of the renderable.

Link copied to clipboard

Adds the Renderable component to an entity.

Link copied to clipboard

Controls if this renderable casts shadows, false by default.

Link copied to clipboard

Set the channel this renderable is associated to. There can be 8 channels. All renderables in a given channel are rendered together, regardless of anything else. They are sorted as usual within a channel.

Link copied to clipboard

Controls frustum culling, true by default.

Link copied to clipboard

Allows bones to be swapped out and shared using SkinningBuffer.

Link copied to clipboard
fun fog(enabled: Boolean = true): RenderableManager.Builder

Controls if this renderable is affected by the large-scale fog.

Link copied to clipboard

Specifies the geometry data for a non-indexed primitive using all vertices.

Specifies the geometry data for a primitive, using the whole index buffer.

Specifies the geometry data for a non-indexed primitive: offset / count refer to vertices.

fun geometry(index: Int, type: RenderableManager.PrimitiveType, vertices: VertexBuffer, indices: IndexBuffer, offset: Int, count: Int): RenderableManager.Builder

Specifies the geometry data for a primitive with offset and count.

fun geometry(index: Int, type: RenderableManager.PrimitiveType, vertices: VertexBuffer, indices: IndexBuffer, offset: Int, minIndex: Int, maxIndex: Int, count: Int): RenderableManager.Builder

Specifies the geometry data for a primitive with explicit min/max indices.

Link copied to clipboard

Specify the type of geometry for this renderable.

Link copied to clipboard

Sets whether the blend order is global or local to this Renderable (by default).

Link copied to clipboard

Specifies the number of draw instances of this renderable. The default is 1 instance and the maximum number of instances allowed is 32767. 0 is invalid.

fun instances(instanceCount: Int, instanceBuffer: InstanceBuffer): RenderableManager.Builder

Draws instanceCount instances (1 to Engine.maxAutomaticInstances), each with its local transform from instanceBuffer, which must hold at least that many and outlive this renderable. All instances are culled with the same bounding box. Only Material.VertexDomain.OBJECT is supported; the material must be instanced to read getInstanceIndex().

Link copied to clipboard

Sets bits in a visibility mask. By default, this is 0x1.

Link copied to clipboard
fun lightChannel(channel: Int, enable: Boolean = true): RenderableManager.Builder

Enables or disables a light channel. Light channel 0 is enabled by default.

Link copied to clipboard
fun material(index: Int, materialInstance: MaterialInstance): RenderableManager.Builder

Binds a material instance to the specified primitive.

Link copied to clipboard

Controls if the renderable has vertex morphing targets, zero by default.

Controls if the renderable has legacy vertex morphing targets, zero by default.

fun morphing(level: Int, primitiveIndex: Int, offset: Int): RenderableManager.Builder

Specifies the morph target buffer offset for a primitive.

Link copied to clipboard

Provides coarse-grained control over draw order.

Link copied to clipboard

Controls if this renderable receives shadows, true by default.

Link copied to clipboard

Controls if this renderable uses screen-space contact shadows. This is more expensive but can improve the quality of shadows, especially in large scenes. (off by default).

Link copied to clipboard

Enables GPU vertex skinning for up to 255 bones, 0 by default.

fun skinning(boneCount: Int, transforms: FloatArray): RenderableManager.Builder

Enables GPU vertex skinning for up to 255 bones with initial bone transforms.

fun skinning(skinningBuffer: SkinningBuffer, count: Int, offset: Int): RenderableManager.Builder

Enables GPU vertex skinning from a region of a SkinningBuffer.