public final class GltfModel implements 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 methods

static final @NonNull ListenableFuture<@NonNull GltfModel>

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

static final @NonNull ListenableFuture<@NonNull GltfModel>
@MainThread
create(
    @NonNull Session session,
    @NonNull byte[] assetData,
    @NonNull String assetKey
)

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

boolean
equals(Object other)
int

Public methods

create

Added in 1.0.0-alpha04
@MainThread
public static final @NonNull ListenableFuture<@NonNull GltfModelcreate(@NonNull Session session, @NonNull String name)

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
@NonNull Session session

The Session to use for loading the model.

@NonNull String name

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

Returns
@NonNull ListenableFuture<@NonNull GltfModel>

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

create

Added in 1.0.0-alpha04
@MainThread
public static final @NonNull ListenableFuture<@NonNull GltfModelcreate(
    @NonNull Session session,
    @NonNull byte[] assetData,
    @NonNull String assetKey
)

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
@NonNull Session session

The Session to use for loading the model.

@NonNull byte[] assetData

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

@NonNull String assetKey

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

Returns
@NonNull ListenableFuture<@NonNull GltfModel>

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

equals

public boolean equals(Object other)

hashCode

public int hashCode()