Class Material.Builder
- java.lang.Object
-
- com.google.ar.sceneform.rendering.Material.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<Material>build()Creates a newMaterialbased on the parameters set previously.Material.BuildersetRegistryId(java.lang.Object registryId)Allows aMaterialto be reused.Material.BuildersetSource(android.content.Context context, int resource)Allows aMaterialto be constructed from resource.Material.BuildersetSource(android.content.Context context, android.net.Uri sourceUri)Allows aMaterialto be constructed fromUri.Material.BuildersetSource(java.nio.ByteBuffer materialBuffer)Allows aMaterialto be created with data.Material.BuildersetSource(java.util.concurrent.Callable<java.io.InputStream> inputStreamCreator)Allows aMaterialto be constructed via callable function.
-
-
-
Method Detail
-
setSource
public Material.Builder setSource(java.nio.ByteBuffer materialBuffer)
Allows aMaterialto be created with data.Construction will be immediate. Please use
setRegistryId(Object)to register this material for reuse.- Parameters:
materialBuffer- Sets the material data.- Returns:
Material.Builderfor chaining setup calls
-
setSource
public Material.Builder setSource(android.content.Context context, android.net.Uri sourceUri)
Allows aMaterialto be constructed fromUri. Construction will be asynchronous.- Parameters:
context- Sets theContextused for loading the resourcesourceUri- Sets a remote Uri or android resource Uri. The material will be added to the registry using the Uri. A previously registered material with the same Uri will be re-used.- Returns:
Material.Builderfor chaining setup calls
-
setSource
public Material.Builder setSource(android.content.Context context, int resource)
Allows aMaterialto be constructed from resource.Construction will be asynchronous.
- Parameters:
context- Sets theContextused for loading the resourceresource- an android resource with raw type. A previously registered material with the same resource id will be re-used.- Returns:
Material.Builderfor chaining setup calls
-
setSource
public Material.Builder setSource(java.util.concurrent.Callable<java.io.InputStream> inputStreamCreator)
Allows aMaterialto be constructed via callable function.- Parameters:
inputStreamCreator- Supplies anInputStreamwith theMaterialdata- Returns:
Material.Builderfor chaining setup calls
-
setRegistryId
public Material.Builder setRegistryId(java.lang.Object registryId)
Allows aMaterialto be reused. If registryId is non-null it will be saved in a registry and the registry will be checked for this id before construction.- Parameters:
registryId- allows the function to be skipped and a previous material to be re-used- Returns:
Material.Builderfor chaining setup calls
-
-