# GltfAnimationStartOptions

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

*** ** * ** ***


```
@RequiresApi(value = 26)
@ExperimentalGltfAnimationApi
class GltfAnimationStartOptions
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

Animation options for starting a `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimation`.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#seekStartTime()` is negative. |

## Summary

| ### Public constructors |
|---|
| `[GltfAnimationStartOptions](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#GltfAnimationStartOptions(kotlin.Boolean,kotlin.Float,java.time.Duration))( shouldLoop: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, speed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, seekStartTime: https://developer.android.com/reference/java/time/Duration.html )` **This function is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions` | `[copy](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#copy(kotlin.Boolean,kotlin.Float,java.time.Duration))(shouldLoop: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, speed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, seekStartTime: https://developer.android.com/reference/java/time/Duration.html)` **This function is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[equals](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#equals(kotlin.Any))(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` **This function is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[hashCode](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#hashCode())()` **This function is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `[toString](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#toString())()` **This function is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#seekStartTime()` **This property is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#shouldLoop()` **This property is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#speed()` **This property is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |

## Public constructors

### GltfAnimationStartOptions

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

```
[GltfAnimationStartOptions](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#GltfAnimationStartOptions(kotlin.Boolean,kotlin.Float,java.time.Duration))(
    shouldLoop: Boolean = false,
    speed: Float = 1.0f,
    seekStartTime: Duration = Duration.ZERO
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

## Public functions

### copy

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

```
fun [copy](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#copy(kotlin.Boolean,kotlin.Float,java.time.Duration))(
    shouldLoop: Boolean = this.shouldLoop,
    speed: Float = this.speed,
    seekStartTime: Duration = this.seekStartTime
): GltfAnimationStartOptions
```

> [!CAUTION]
> **This function is deprecated.**   
> Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

Creates a copy of the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions` object with the given values.

### equals

```
open operator fun [equals](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#equals(kotlin.Any))(other: Any?): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

### hashCode

```
open fun [hashCode](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#hashCode())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

### toString

```
open fun [toString](https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#toString())(): String
```

> [!CAUTION]
> **This function is deprecated.**   
> Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

## Public properties

### seekStartTime

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

```
val seekStartTime: Duration
```

> [!CAUTION]
> **This property is deprecated.**   
> Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

The start offset. Default is `https://developer.android.com/reference/java/time/Duration.html#ZERO`.

This value defines the **starting boundary** of the playback window. The effective playback window is the range between `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#seekStartTime()` and the animation's total duration.

**Constraints:**

- Must be greater than or equal to zero.

- If `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#seekStartTime()` is greater than the duration, it is clamped to the duration (resulting in a zero-length playback window).

**Note on Reverse Playback:** If `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#speed()` is negative and `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#shouldLoop()` is false, the animation stops when it reaches `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#seekStartTime()`. To play in reverse, the application must explicitly set the playhead to a valid position between `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfAnimationStartOptions#seekStartTime()` and the duration.

### shouldLoop

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

```
val shouldLoop: Boolean
```

> [!CAUTION]
> **This property is deprecated.**   
> Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

Whether the animation plays in a loop.

### speed

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

```
val speed: Float
```

> [!CAUTION]
> **This property is deprecated.**   
> Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

The playback rate. Default is 1.0.

- **1.0:** Normal speed.

- **\> 1.0:** Faster playback.

- **\> 0.0 and \< 1.0:** Slower playback (e.g., 0.5 is half speed).

- **0.0:** Freezes the animation at the current frame while keeping it active.

- **\< 0.0:** Plays the animation in reverse.