ModelRenderable

public class ModelRenderable

Renders a 3D Model by attaching it to a Node with setRenderable(Renderable).

future = ModelRenderable.builder().setSource(context, R.raw.renderable).build();
 renderable = future.thenAccept(...);
 

Nested Classes

class ModelRenderable.Builder Factory class for ModelRenderable

Inherited Constants

Inherited Fields

Public Methods

static ModelRenderable.Builder
builder()
Constructs a ModelRenderable.
AnimationData
getAnimationData(int index)
Returns the AnimationData at the specified position packaged in this ModelRenderable.
AnimationData
getAnimationData(String name)
Returns AnimationData with matching name or null.
int
getAnimationDataCount()
Returns the total number of AnimationData packaged with this ModelRenderable.
int
getBoneCount()
Returns the number of bones in this renderable if it is skinned.
String
getBoneName(int boneIndex)
Returns the name of the bone for the specified bone index.
int
getBoneParentIndex(int boneIndex)
Returns the index of the parent bone for the specified bone index.
ModelRenderable
makeCopy()
Creates a new instance of this ModelRenderable.

Inherited Methods

Public Methods

public static ModelRenderable.Builder builder ()

Constructs a ModelRenderable.

public AnimationData getAnimationData (int index)

Returns the AnimationData at the specified position packaged in this ModelRenderable.

Parameters
index
Throws
IndexOutOfBoundsException} - if the index is out of range (index < 0 || index >= getAnimationDataCount()).

public AnimationData getAnimationData (String name)

Returns AnimationData with matching name or null.

Parameters
name

public int getAnimationDataCount ()

Returns the total number of AnimationData packaged with this ModelRenderable.

public int getBoneCount ()

Returns the number of bones in this renderable if it is skinned. If this renderable is not skinned, returns 0.

public String getBoneName (int boneIndex)

Returns the name of the bone for the specified bone index.

Parameters
boneIndex
Throws
IndexOutOfBoundsException if the boneIndex is >= getBoneCount().

public int getBoneParentIndex (int boneIndex)

Returns the index of the parent bone for the specified bone index. If the bone has no parent it is a root bone and -1 is returned.

Parameters
boneIndex
Throws
IndexOutOfBoundsException if the boneIndex is >= getBoneCount().

public ModelRenderable makeCopy ()

Creates a new instance of this ModelRenderable.

The new renderable will have unique copy of all mutable state. All materials referenced by the ModelRenderable will also be instanced. Immutable data will be shared between the instances.