# SubspacePlaceable.SubspacePlacementScope

Artifact: [androidx.xr.compose:compose](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/subspace/layout/SubspacePlaceable.kt+class:androidx.xr.compose.subspace.layout.SubspacePlaceable.SubspacePlacementScope) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)


```
abstract class SubspacePlaceable.SubspacePlacementScope
```

<br />

*** ** * ** ***

Receiver scope that permits explicit placement of a `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope#SubspacePlacementScope()()` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope#(androidx.xr.compose.subspace.layout.SubspacePlaceable).place(androidx.xr.runtime.math.Pose)(pose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose)` Place a `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable` at the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` in its parent's coordinate system. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope#(androidx.xr.compose.subspace.layout.SubspacePlaceable).placeRelative(androidx.xr.runtime.math.Pose)(pose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose)` Place a `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable` at the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` in its parent's coordinate system with an auto-mirrored position along the YZ plane if the parent layout direction is `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection#Rtl`. |

| ### Public properties |
|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspaceLayoutCoordinates?` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope#coordinates()` The `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspaceLayoutCoordinates` of this layout, if known or `null` if the layout hasn't been placed yet. |

| ### Protected properties |
|---|---|
| `abstract https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope#parentLayoutDirection()` Keeps the layout direction of the parent of the subspace placeable that is being placed using current `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope`. |

## Public constructors

### SubspacePlacementScope

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
SubspacePlacementScope()
```

## Public functions

### SubspacePlaceable.place

Artifact: [androidx.xr.compose:compose](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/subspace/layout/SubspacePlaceable.kt+function:place) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
fun SubspacePlaceable.place(pose: Pose): Unit
```

Place a `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable` at the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` in its parent's coordinate system.

| Parameters |
|---|---|
| `pose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | The pose of the layout. |

### SubspacePlaceable.placeRelative

Artifact: [androidx.xr.compose:compose](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/subspace/layout/SubspacePlaceable.kt+function:placeRelative) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
fun SubspacePlaceable.placeRelative(pose: Pose): Unit
```

Place a `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable` at the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` in its parent's coordinate system with an auto-mirrored position along the YZ plane if the parent layout direction is `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection#Rtl`.

If the `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope#parentLayoutDirection()` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection#Rtl`, this function calculates a new pose by mirroring the original `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope#(androidx.xr.compose.subspace.layout.SubspacePlaceable).placeRelative(androidx.xr.runtime.math.Pose)` across the YZ plane. This ensures that layouts designed for LTR behave intuitively when the locale is switched to RTL.

The mirroring transformation involves:

1. Translation: The `x` component of the translation vector is negated (`x -> -x`). This moves the object from the right side to the left side, or vice versa.

2. Rotation: The `y` and `z` components of the underlying quaternion are negated. This has the effect of reversing the direction of yaw (rotation around the Y-axis) and roll (rotation around the Z-axis), while leaving pitch (rotation around the X-axis) unchanged.

For example, a pose that places an object 20 dp to the left and yawed 30 degrees to the right will be transformed to place the object 20 dp to the right and yawed 30 degrees to the left.

If the layout direction is LTR, the original `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope#(androidx.xr.compose.subspace.layout.SubspacePlaceable).placeRelative(androidx.xr.runtime.math.Pose)` is used without modification.

This API is not mirroring the internal mesh geometry of 3D models. This function only affects pose of the layout.

| Parameters |
|---|---|
| `pose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | The pose of the layout. |

## Public properties

### coordinates

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
open val coordinates: SubspaceLayoutCoordinates?
```

The `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspaceLayoutCoordinates` of this layout, if known or `null` if the layout hasn't been placed yet.

## Protected properties

### parentLayoutDirection

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
protected abstract val parentLayoutDirection: LayoutDirection
```

Keeps the layout direction of the parent of the subspace placeable that is being placed using current `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope`. Used to support automatic position mirroring for convenient RTL support in custom layouts.