loadInstancedModelAsync

fun loadInstancedModelAsync(fileLocation: String, count: Int, resourceResolver: (resourceFileName: String) -> String = { getFolderPath(fileLocation, it) }, onResult: (List<ModelInstance>) -> Unit): Job

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

Parameters

fileLocation

the .glb or .gltf file location:

  • A relative asset file location models/mymodel.glb

  • An android resource from the res folder context.getResourceUri(R.raw.mymodel)

  • A File path Uri.fromFile(myModelFile).path

  • An http or https url https://mydomain.com/mymodel.glb

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