# 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
public final 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/androidx/xr/scenecore/GltfAnimation`.

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

## Summary

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

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions` | `[copy](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#copy(kotlin.Boolean,kotlin.Float,java.time.Duration))(boolean shouldLoop, float speed, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html seekStartTime)` **This method is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `boolean` | `[equals](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#equals(kotlin.Any))(https://developer.android.com/reference/java/lang/Object.html other)` **This method is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html` | `[getSeekStartTime](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#getSeekStartTime())()` **This method is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `final float` | `[getSpeed](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#getSpeed())()` **This method is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `int` | `[hashCode](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#hashCode())()` **This method is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `final boolean` | `[shouldLoop](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#shouldLoop())()` **This method is deprecated.** Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `[toString](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#toString())()` **This method 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)

```
public [GltfAnimationStartOptions](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#GltfAnimationStartOptions(kotlin.Boolean,kotlin.Float,java.time.Duration))(
    boolean shouldLoop,
    float speed,
    @NonNull Duration seekStartTime
)
```

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

## Public methods

### 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)

```
public final @NonNull GltfAnimationStartOptions [copy](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#copy(kotlin.Boolean,kotlin.Float,java.time.Duration))(boolean shouldLoop, float speed, @NonNull Duration seekStartTime)
```

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

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

### equals

```
public boolean [equals](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#equals(kotlin.Any))(Object other)
```

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

### getSeekStartTime

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)

```
public final @NonNull Duration [getSeekStartTime](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#getSeekStartTime())()
```

> [!CAUTION]
> **This method 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/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/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/androidx/xr/scenecore/GltfAnimationStartOptions#speed()` is negative and `https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#shouldLoop()` is false, the animation stops when it reaches `https://developer.android.com/reference/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/androidx/xr/scenecore/GltfAnimationStartOptions#seekStartTime()` and the duration.

### getSpeed

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)

```
public final float [getSpeed](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#getSpeed())()
```

> [!CAUTION]
> **This method 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.

### hashCode

```
public int [hashCode](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#hashCode())()
```

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

### 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)

```
public final boolean [shouldLoop](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#shouldLoop())()
```

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

Whether the animation plays in a loop.

### toString

```
public @NonNull String [toString](https://developer.android.com/reference/androidx/xr/scenecore/GltfAnimationStartOptions#toString())()
```

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