Builder

abstract class Builder<T : Renderable?, B : Renderable.Builder<T, B>?>

Used to programmatically construct a Renderable. Builder data is stored, not copied. Be careful when modifying the data before or between build calls.

Inheritors

Functions

Link copied to clipboard
fun <T : Renderable, B : Renderable.Builder<T, B>> Renderable.Builder<T, B>.asDeferred(engine: Engine): Deferred<T>

Deferred renderable loading is a non-blocking cancellable future.

Link copied to clipboard
suspend fun <T : Renderable, B : Renderable.Builder<T, B>> Renderable.Builder<T, B>.await(engine: Engine): T

Awaits for loading a Renderable with the parameters of the builder without blocking a thread.

Link copied to clipboard
open fun build(engine: Engine): CompletableFuture<T>
Constructs a Renderable with the parameters of the builder.
Link copied to clipboard
suspend fun <T : Renderable, B : Renderable.Builder<T, B>> Renderable.Builder<T, B>.build(engine: Engine, coroutineScope: LifecycleCoroutineScope)

Load a Renderable in a coroutine scope without blocking a thread.

Link copied to clipboard
open fun hasSource(): Boolean
True if a source function will be called during build
Link copied to clipboard
open fun setAnimationFrameRate(frameRate: Int): B
Sets the number of frames per seconds defined in the asset.
Link copied to clipboard
open fun setAsyncLoadEnabled(asyncLoadEnabled: Boolean): B
Enable textures async loading after first rendering.
Link copied to clipboard
open fun setIsFilamentGltf(isFilamentGltf: Boolean): B
Link copied to clipboard
open fun setRegistryId(@Nullable registryId: Any): B
Link copied to clipboard
open fun setSource(definition: RenderableDefinition): B
open fun setSource(context: Context, sourceUri: Uri): B
open fun setSource(context: Context, resource: Int): B
open fun setSource(context: Context, inputStreamCreator: Callable<InputStream>): B
open fun setSource(context: Context, sourceUri: Uri, uriResolver: (String) -> Uri): B