Package-level declarations

Types

Link copied to clipboard

A builder for spatial UI attachments.

Link copied to clipboard
@Stable
abstract class LoadedModel

Loaded model.

Link copied to clipboard
@Stable
sealed class ModelLoadingState

The state of loading a 3D model.

Link copied to clipboard

The resizability of a 3D model.

Link copied to clipboard
@Stable
open class Source<T>

Defines data source support for SpatialModelView.

Link copied to clipboard
@Stable
interface SpatialAnimationPlayer

Unified entry point that aggregates the animation playback capabilities of a SpatialModelView.

Link copied to clipboard
abstract class SpatialModelScope

Scope for SpatialModelView content function.

Link copied to clipboard

The attachments belong to a SpatialView.

Properties

Link copied to clipboard

Gets the rotation of the volume towards to observer .

Functions

Link copied to clipboard
@Composable
fun attachmentPanelComponent(context: Context = LocalContext.current, size: IntSize = panelSize(Dp.Unspecified, Dp.Unspecified), alignment: AttachmentPanelComponent.Alignment = AttachmentPanelComponent.Alignment.UNSPECIFIED, content: @Composable () -> Unit): AttachmentPanelComponent

Creates a AttachmentPanelComponent in another Composable. Notice that this function is for your convenience to create a AttachmentPanelComponent in your Composable, once the return value set to an Entity, your later changes will not take effect.

Link copied to clipboard
fun AttachmentPanelComponent.content(compositionContext: CompositionContext? = null, content: @Composable () -> Unit): AttachmentPanelComponent

Sets the content of the AttachmentPanelComponent.

Link copied to clipboard
suspend fun Entity.Companion.loadFrom(source: Source<*>): Entity

Loads an entity from Source. It runs on the IO thread and automatically destroys the entity when the coroutine is canceled.

Link copied to clipboard
@Composable
fun SpatialModelScope.Model(model: LoadedModel, modifier: Modifier = Modifier)

Displays 3d model when load success.

Link copied to clipboard
@Composable
fun panelSize(@FloatRange(from = 0.0, to = 2048.0) width: Dp, @FloatRange(from = 0.0, to = 2048.0) height: Dp): IntSize

Converts the Dp size to IntSize in pixel for AttachmentPanelComponent using. If the Dp is Dp.Unspecified, the IntSize will be WRAP_CONTENT.

@Composable
fun panelSize(width: Float, height: Float, lengthUnit: LengthUnit = LengthUnit.Meters): IntSize

Converts the Float size of length unit to IntSize in pixel for AttachmentPanelComponent using. If the Float is Float.NaN, the IntSizewill be WRAP_CONTENT.

Link copied to clipboard

Sets compose color to PhysicallyBasedMaterial for convenience.

fun UnlitMaterial.setBaseColor(color: Color)

Sets compose color to UnlitMaterial for convenience.

Link copied to clipboard
@Composable
fun SpatialModelView(source: Source<*>, modifier: Modifier = Modifier, resizability: Resizability = Resizability.None, content: @Composable SpatialModelScope.(state: ModelLoadingState) -> Unit = { state -> if (state is ModelLoadingState.Success) { Model(state.model) } })

A view that asynchronously loads and displays a 3D model from source.

@Composable
fun SpatialModelView(source: Source<*>, modifier: Modifier = Modifier, resizability: Resizability = Resizability.None, onLoad: () -> Unit? = null, onError: (String) -> Unit? = null, onSuccess: (LoadedModel) -> Unit? = null, content: @Composable SpatialModelScope.() -> Unit = {})

A view that asynchronously loads and displays a 3D model from source, while exposing the load lifecycle through callbacks.

Link copied to clipboard
@Composable
fun SpatialView(modifier: Modifier = Modifier, update: (content: SpatialViewContent, attachments: SpatialViewAttachments) -> Unit? = null, attachments: AttachmentPanelBuilder.() -> Unit? = null, initial: suspend (content: SpatialViewContent, attachments: SpatialViewAttachments) -> Unit)

The container for 3D content.

Link copied to clipboard
fun Color.toColor4(): Color4

Converts compose Color to ecs Color4 for compose developers.