PlanarEmbeddedSubspace
Android
@Composable // b/446706254
public fun PlanarEmbeddedSubspace(
content: @Composable @SubspaceComposable SpatialBoxScope.() -> Unit
)
Creates a 3D space for spatial content that is embedded within and positioned by a 2D container.
A PlanarEmbeddedSubspace acts as a bridge between a 2D layout context and a 3D spatial scene. It must be placed within a composable that provides a 2D surface in the 3D world, such as SpatialPanel, Orbiter, or a custom component built on similar principles.
The PlanarEmbeddedSubspace itself is laid out like a regular 2D composable, respecting the constraints and positioning of its parent. The 3D content placed inside it is then positioned relative to this 2D-defined area.
Key behaviors:
- Layout: The width and height are determined by the parent 2D layout. The depth (Z-axis) constraints are inherited from the surrounding spatial environment, allowing content to extend forwards and backwards from the 2D surface.
- Content: The
contentlambda is a@SubspaceComposablescope, where you can place 3D elements like SpatialBox. - Environment: This composable is a no-op and renders nothing in non-XR environments (e.g., phones and tablets).
Parameters
| content | The @SubspaceComposable 3D content to render within this subspace. |