GltfAnimationStartOptions


@RequiresApi(value = 26)
@ExperimentalGltfAnimationApi
class GltfAnimationStartOptions


Animation options for starting a GltfAnimation.

Throws
IllegalArgumentException

if seekStartTime is negative.

Summary

Public constructors

GltfAnimationStartOptions(
    shouldLoop: Boolean,
    speed: Float,
    seekStartTime: Duration
)

This function is deprecated. Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

Public functions

GltfAnimationStartOptions
copy(shouldLoop: Boolean, speed: Float, seekStartTime: Duration)

This function is deprecated. Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

open operator Boolean
equals(other: Any?)

This function is deprecated. Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

open Int

This function is deprecated. Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

open String

This function is deprecated. Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

Public properties

Duration

This property is deprecated. Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

Boolean

This property is deprecated. Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

Float

This property is deprecated. Use GltfAnimation.loop and GltfAnimation.speed properties with parameterless start() instead.

Public constructors

GltfAnimationStartOptions

Added in 1.0.0
Deprecated in 1.1.0-alpha01
GltfAnimationStartOptions(
    shouldLoop: Boolean = false,
    speed: Float = 1.0f,
    seekStartTime: Duration = Duration.ZERO
)

Public functions

copy

Added in 1.0.0
Deprecated in 1.1.0-alpha01
fun copy(
    shouldLoop: Boolean = this.shouldLoop,
    speed: Float = this.speed,
    seekStartTime: Duration = this.seekStartTime
): GltfAnimationStartOptions

Creates a copy of the GltfAnimationStartOptions object with the given values.

equals

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

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

seekStartTime

Added in 1.0.0
Deprecated in 1.1.0-alpha01
val seekStartTime: Duration

The start offset. Default is Duration.ZERO.

This value defines the starting boundary of the playback window. The effective playback window is the range between seekStartTime and the animation's total duration.

Constraints:

  • Must be greater than or equal to zero.

  • If seekStartTime is greater than the duration, it is clamped to the duration (resulting in a zero-length playback window).

Note on Reverse Playback: If speed is negative and shouldLoop is false, the animation stops when it reaches seekStartTime. To play in reverse, the application must explicitly set the playhead to a valid position between seekStartTime and the duration.

shouldLoop

Added in 1.0.0
Deprecated in 1.1.0-alpha01
val shouldLoop: Boolean

Whether the animation plays in a loop.

speed

Added in 1.0.0
Deprecated in 1.1.0-alpha01
val speed: Float

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.