createInstancedModel

fun createInstancedModel(buffer: Buffer, count: Int, resourceResolver: (resourceFileName: String) -> Buffer? = { null }): List<ModelInstance>

Creates a Model with one or more ModelInstances from the contents of a GLB or GLTF file.

Consumes the contents of a glTF 2.0 file and produces a primary asset with one or more instances.

Parameters

count

must be sized to the desired number of instances. If successful, this method will populate the array with secondary instances whose resources are shared with the primary asset.

See also

AssetLoader.createInstancedAsset

fun createInstancedModel(assetFileLocation: String, count: Int, resourceResolver: (resourceFileName: String) -> Buffer? = { context.assets.readBuffer(getFolderPath(assetFileLocation, it)) }): List<ModelInstance>
fun createInstancedModel(@RawRes rawResId: Int, count: Int, resourceResolver: (resourceFileName: String) -> Buffer? = { null }): List<ModelInstance>
fun createInstancedModel(file: File, count: Int, resourceResolver: (resourceFileName: String) -> Buffer? = { resourceFile -> File(file.parent, resourceFile).readBuffer() }): List<ModelInstance>

Creates a primary Model with one or more ModelInstances from the contents of a GLB or GLTF file.

Parameters

count

must be sized to the desired number of instances. If successful, this method will populate the array with secondary instances whose resources are shared with the primary asset.

See also