Class ModelProvider

com.yandex.runtime.model

public abstract class ModelProvider

Provides the model data.

Methods

ModelProvider fromAsset(final Context context, final String assetName, final ImageProvider texture)

Returns a model provider based on a given asset (from the assets/ directory).

ModelProvider fromByteArray(final byte[] model, final ImageProvider texture)

Returns a model provider based on the given data.

ModelProvider fromFile(final String fileName, final ImageProvider texture)

Returns a model provider based on a model file from the internal storage.

ModelProvider fromResource(final Context context, final int resourceId, final ImageProvider texture)

Returns a model provider based on a given resource.

abstract String getId()

Returns the unique identifier for the model.

abstract ByteBuffer getModel()

Returns a model data buffer.

abstract ImageProvider getTexture()

Returns an image provider of the model texture.

Method Detail

fromAsset

public static ModelProvider fromAsset (final Context context, final String assetName, final ImageProvider texture)

Returns a model provider based on a given asset (from the assets/ directory).

Supports only OBJ format.

fromByteArray

public static ModelProvider fromByteArray (final byte[] model, final ImageProvider texture)

Returns a model provider based on the given data.

Supports only OBJ format.

fromFile

public static ModelProvider fromFile (final String fileName, final ImageProvider texture)

Returns a model provider based on a model file from the internal storage.

Supports only OBJ format.

fromResource

public static ModelProvider fromResource (final Context context, final int resourceId, final ImageProvider texture)

Returns a model provider based on a given resource.

Supports only OBJ format.

getId

public abstract String getId ()

Returns the unique identifier for the model.

Providers can be cached based on it.

getModel

public abstract ByteBuffer getModel ()

Returns a model data buffer.

getTexture

public abstract ImageProvider getTexture ()

Returns an image provider of the model texture.