class GltfModel : Model


GltfModel represents a glTF resource in SceneCore. These can be used as part of the Environment or to display 3D models with GltfModelEntity. These are created by the Session.

Summary

Public companion functions

ListenableFuture<GltfModel>
@MainThread
create(session: Session, name: String)

Public factory function for a GltfModel, where the glTF is asynchronously loaded.

ListenableFuture<GltfModel>
@MainThread
create(session: Session, assetData: ByteArray, assetKey: String)

Public factory function for a GltfModel, where the glTF is asynchronously loaded.

Public functions

open operator Boolean
equals(other: Any?)
open Int

Public companion functions

create

Added in 1.0.0-alpha04
@MainThread
fun create(session: Session, name: String): ListenableFuture<GltfModel>

Public factory function for a GltfModel, where the glTF is asynchronously loaded.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Currently, only URLs and relative paths from the android_assets/ directory are supported. Currently, only binary glTF (.glb) files are supported.

Parameters
session: Session

The Session to use for loading the model.

name: String

The URL or asset-relative path of a binary glTF (.glb) model to be loaded

Returns
ListenableFuture<GltfModel>

a ListenableFuture. Listeners will be called on the main thread if Runnable::run is supplied.

create

Added in 1.0.0-alpha04
@MainThread
fun create(session: Session, assetData: ByteArray, assetKey: String): ListenableFuture<GltfModel>

Public factory function for a GltfModel, where the glTF is asynchronously loaded.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Currently, only binary glTF (.glb) files are supported.

Parameters
session: Session

The Session to use for loading the model.

assetData: ByteArray

The byte array data of a binary glTF (.glb) model to be loaded.

assetKey: String

The key to use for the model. This is used to identify the model in the SceneCore cache.

Returns
ListenableFuture<GltfModel>

a ListenableFuture. Listeners will be called on the main thread if Runnable::run is supplied.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int