# MovableComponentTester

Artifact: [androidx.xr.scenecore:scenecore-testing](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/testing/MovableComponentTester.kt+class:androidx.xr.scenecore.testing.MovableComponentTester) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
class MovableComponentTester
```

<br />

*** ** * ** ***

A test-only accessor for `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent` that enables direct manipulation and inspection of its internal state.

## Summary

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveEnd(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.Entity)( finalInputRay: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Ray, finalPose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose, finalScale: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, updatedParent: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity? )` Simulates the end of a move event from the runtime, notifying all registered listeners. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveStart(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.Entity)( initialInputRay: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Ray, initialPose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose, initialScale: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3, initialParent: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity )` Simulates the start of a move event from the runtime, notifying all registered listeners. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveUpdate(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3)( currentInputRay: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Ray, currentPose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose, currentScale: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3 )` Simulates an update to an ongoing move event from the runtime, notifying all registered listeners. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#isAnchorable()` Whether this component is user-anchorable. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#isScaleInZ()` Whether this component scales in Z. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#isSystemMovable()` Whether this component is system-movable. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### triggerOnMoveEnd

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

```
fun triggerOnMoveEnd(
    finalInputRay: Ray,
    finalPose: Pose,
    finalScale: Vector3,
    updatedParent: Entity? = null
): Unit
```

Simulates the end of a move event from the runtime, notifying all registered listeners.

This triggers callbacks registered via `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#addMoveListener(java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)`.

| Parameters |
|---|---|
| `finalInputRay: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Ray` | The final ray origin and direction in activity space. |
| `finalPose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | The final pose of the entity, relative to its parent. |
| `finalScale: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | The final scale of the entity. |
| `updatedParent: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity? = null` | The updated parent of the entity if it was changed during the move. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveStart(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.Entity)` has not been called. |

### triggerOnMoveStart

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

```
fun triggerOnMoveStart(
    initialInputRay: Ray,
    initialPose: Pose,
    initialScale: Vector3,
    initialParent: Entity
): Unit
```

Simulates the start of a move event from the runtime, notifying all registered listeners.

This triggers callbacks registered via `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#addMoveListener(java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)`.

| Parameters |
|---|---|
| `initialInputRay: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Ray` | The initial ray origin and direction in activity space. |
| `initialPose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | The initial pose of the entity, relative to its parent. |
| `initialScale: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | The initial scale of the entity. |
| `initialParent: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity` | The parent of the entity at the start of the move. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | If a move is already in progress. |

### triggerOnMoveUpdate

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

```
fun triggerOnMoveUpdate(
    currentInputRay: Ray,
    currentPose: Pose,
    currentScale: Vector3
): Unit
```

Simulates an update to an ongoing move event from the runtime, notifying all registered listeners.

This triggers callbacks registered via `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#addMoveListener(java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)`.

| Parameters |
|---|---|
| `currentInputRay: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Ray` | The current ray origin and direction in activity space. |
| `currentPose: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Pose` | The current pose of the entity, relative to its parent. |
| `currentScale: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | The current scale of the entity. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveStart(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.Entity)` has not been called. |

## Public properties

### isAnchorable

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

```
val isAnchorable: Boolean
```

Whether this component is user-anchorable.

This is set to `true` when created via `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#createAnchorable(androidx.xr.runtime.Session,kotlin.collections.Set,kotlin.Boolean)`, and `false` otherwise.

### isScaleInZ

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

```
val isScaleInZ: Boolean
```

Whether this component scales in Z.

This corresponds to the `scaleInZ` parameter used in `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#createCustomMovable(androidx.xr.runtime.Session,kotlin.Boolean,java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)` or `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#createSystemMovable(androidx.xr.runtime.Session,kotlin.Boolean)`. It is always `false` when created via `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#createAnchorable(androidx.xr.runtime.Session,kotlin.collections.Set,kotlin.Boolean)`.

### isSystemMovable

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

```
val isSystemMovable: Boolean
```

Whether this component is system-movable.

This is set to `true` when created via `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#createSystemMovable(androidx.xr.runtime.Session,kotlin.Boolean)` or `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#createAnchorable(androidx.xr.runtime.Session,kotlin.collections.Set,kotlin.Boolean)`, and `false` when created via `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/MovableComponent#createCustomMovable(androidx.xr.runtime.Session,kotlin.Boolean,java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)`.