AI-generated Key Takeaways
-
RenderableSource.Builderis used to create and configure aRenderableSourcefor importing 3D models. -
It allows customization of model import settings, such as scale and recenter mode, through methods like
setScaleandsetRecenterMode. -
The
setSourcemethod specifies the model's URI and its type for importing. -
Finally, the
buildmethod creates theRenderableSourceinstance based on the provided configuration.
Builder used to configure and create a converter.
Public Constructors
Public Methods
| RenderableSource |
build()
Builds a RenderableSource configured according to the settings applied to this Builder.
|
| RenderableSource.Builder |
setRecenterMode(RenderableSource.RecenterMode recenterMode)
Sets the recenter mode to apply to the model when it is imported.
|
| RenderableSource.Builder |
setScale(float scale)
Sets the scale to apply to the model when it is imported.
|
| RenderableSource.Builder |
setSource(Context context, Uri modelUri, RenderableSource.SourceType sourceType)
Sets the Uri of the asset to be imported.
|
Inherited Methods
Public Constructors
public RenderableSource.Builder ()
Public Methods
public RenderableSource build ()
Builds a RenderableSource configured according to the settings applied to this Builder.
Returns
- the configured Converter, which is appropriate to be used as the source for a ModelRenderable.Builder.
public RenderableSource.Builder setRecenterMode (RenderableSource.RecenterMode recenterMode)
Sets the recenter mode to apply to the model when it is imported.
Parameters
| recenterMode | the recenter mode to apply when importing the model. |
|---|
public RenderableSource.Builder setScale (float scale)
Sets the scale to apply to the model when it is imported. If scale is unset, the default behavior is that very large and very small objects will have their scale adjusted in order that their largest dimension will be no smaller than 5 cm, and no larger than 1 meter. To disable automatic scaling set the scale to 1.0.
Parameters
| scale | the scale to apply when importing the model. |
|---|
public RenderableSource.Builder setSource (Context context, Uri modelUri, RenderableSource.SourceType sourceType)
Sets the Uri of the asset to be imported.
Parameters
| context | |
|---|---|
| modelUri | the Uri of the raw asset. |
| sourceType | the expected of the raw asset type. |