GltfModelEntity
public final class GltfModelEntity extends Entity
| java.lang.Object | |||
| ↳ | androidx.xr.scenecore.BaseScenePose | ||
| ↳ | androidx.xr.scenecore.Entity | ||
| ↳ | androidx.xr.scenecore.GltfModelEntity |
GltfModelEntity is a concrete implementation of Entity that hosts a glTF model.
Note: The size property of this Entity is always reported as {0, 0, 0}, regardless of the actual size of the model.
Summary
Public methods |
|
|---|---|
static final @NonNull GltfModelEntity |
@MainThreadPublic factory function for a |
final @NonNull List<@NonNull GltfAnimation> |
@MainThreadA list of all |
final @NonNull List<@NonNull GltfModelNode> |
A list of all |
Inherited methods |
||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||
|
Public methods
create
@MainThread
public static final @NonNull GltfModelEntity create(
@NonNull Session session,
@NonNull GltfModel model,
@NonNull Pose pose,
Entity parent
)
Public factory function for a GltfModelEntity.
This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads
| Parameters | |
|---|---|
@NonNull Session session |
|
@NonNull GltfModel model |
|
@NonNull Pose pose |
The initial |
Entity parent |
Parent entity. Defaults to |
getAnimations
@MainThread
@RequiresApi(value = 26)
@ExperimentalGltfAnimationApi
public final @NonNull List<@NonNull GltfAnimation> getAnimations()
A list of all GltfAnimations defined in the GltfModelEntity. The list is lazily initialized on the first access.
The returned list corresponds to the array of animations defined in the source glTF file. The order of elements in this list is guaranteed to match the order of animations in the glTF file's animations array.
getNodes
@MainThread
public final @NonNull List<@NonNull GltfModelNode> getNodes()
A list of all GltfModelNodes defined in the GltfModelEntity. The list is lazily initialized on the first access.
The returned list corresponds to the flattened array of nodes defined in the source glTF file. The order of elements in this list is guaranteed to match the order of nodes in the glTF file's nodes array.