public abstract class SubspacePlacementScope
Receiver scope that permits explicit placement of a SubspacePlaceable.
Functions
place
public fun SubspacePlaceable.place(pose: Pose)
Place a SubspacePlaceable at the Pose in its parent's coordinate system.
Parameters
| pose | The pose of the layout. |
placeRelative
public fun SubspacePlaceable.placeRelative(pose: Pose)
Place a SubspacePlaceable at the Pose in its parent's coordinate system with auto mirrored position along YZ plane if parent layout direction is LayoutDirection.Rtl.
If the parentLayoutDirection is LayoutDirection.Rtl, this function calculates a new pose by mirroring the original 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:
- Translation: The
xcomponent of the translation vector is negated (x -> -x). This moves the object from the right side to the left side, or vice versa. - Rotation: The
yandzcomponents 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 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 | The pose of the layout. |