class GltfModel


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

Summary

Public companion functions

suspend GltfModel
@MainThread
create(session: Session, path: Path)

Public factory for a GltfModel, where the glTF is asynchronously loaded from a Path relative to the application's assets/ folder.

suspend GltfModel
@MainThread
create(session: Session, uri: Uri)

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

Public functions

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

Public companion functions

create

@MainThread
suspend fun create(session: Session, path: Path): GltfModel

Public factory for a GltfModel, where the glTF is asynchronously loaded from a Path relative to the application's assets/ folder.

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

Parameters
session: Session

The Session to use for loading the model.

path: Path

The Path of the binary glTF (.glb) model to be loaded, relative to the application's assets/ folder.

Returns
GltfModel

a GltfModel upon completion.

Throws
kotlin.IllegalArgumentException

if path.isAbsolute is true, as this method requires a relative path.

create

@MainThread
suspend fun create(session: Session, uri: Uri): GltfModel

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

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

Parameters
session: Session

The Session to use for loading the model.

uri: Uri

The Uri for a binary glTF (.glb) model to be loaded.

Returns
GltfModel

a GltfModel upon completion.

Public functions

equals

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

hashCode

open fun hashCode(): Int