GltfModel
public final class GltfModel implements AutoCloseable
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 methods |
|
|---|---|
void |
Closes the given |
static final @NonNull GltfModel |
Public factory for a GltfModel, where the glTF is asynchronously loaded from a |
static final @NonNull GltfModel |
Public factory for a GltfModel, where the glTF is asynchronously loaded from a |
boolean |
|
int |
hashCode() |
Public methods
close
@MainThread
public void close()
Closes the given GltfModel.
The GltfModel can be explicitly closed at any time or garbage collected. When either happens, its resources are freed. If close() is not explicitly invoked by the client, the GltfModel will be automatically closed when the GltfModel is garbage collected.
| Throws | |
|---|---|
IllegalStateException |
if the resource has already been closed. |
create
@MainThread
public static final @NonNull GltfModel create(@NonNull Session session, @NonNull Path path)
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 | |
|---|---|
@NonNull Session session |
The |
@NonNull Path path |
The Path of the binary glTF (.glb) model to be loaded, relative to the application's |
| Throws | |
|---|---|
IllegalArgumentException |
if |
create
@MainThread
public static final @NonNull GltfModel create(@NonNull Session session, @NonNull Uri uri)
Public factory for a GltfModel, where the glTF is asynchronously loaded from a Uri.
Currently, only binary glTF (.glb) files are supported.