SpatialModelView
A view that asynchronously loads and displays a 3D model from source, while exposing the load lifecycle through callbacks.
This overload is intended for observing the loading lifecycle or triggering side effects. If you need to render different UI for different states based on the load state, use the SpatialModelView overload that exposes ModelLoadingState in content.
Parameters
The data source of a 3D model. For example, you can load a model file located in android assets directory to this SpatialModelView.
The modifier to be applied to SpatialModelView.
An enum value which indicates whether the loaded model should resize to fit the SpatialModelView size.
Callback invoked when the loading state enters ModelLoadingState.Loading.
Callback invoked after the loading state changes to ModelLoadingState.Error. The callback parameter is the failure reason.
Callback invoked after the loading state changes to ModelLoadingState.Success. The callback parameter is the loaded model.
A composable function displayed inside the view while the load callbacks are being observed. The default implementation renders no content.
A view that asynchronously loads and displays a 3D model from source.
Parameters
The data source of a 3D model. For example, you can load a model file located in android assets directory to this SpatialModelView.
The modifier to be applied to SpatialModelView.
An enum value which indicates whether the loaded model should resize to fit the SpatialModelView size.
A composable function takes the load state as an input. So you can determine what to show according to the state. For example, you can display a loading view as place holder. when state is ModelLoadingState.Loading, and when the model loaded successfully, which means the state is ModelLoadingState.Success, you can display the model by Model function.