GltfAnimationStartOptions


@RequiresApi(value = 26)
class GltfAnimationStartOptions


Animation options for starting a GltfAnimation.

Throws
IllegalArgumentException

if seekStartTime is negative.

Summary

Public constructors

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

Public functions

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

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

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Duration

The start offset.

Boolean

Whether the animation plays in a loop.

Float

The playback rate.

Public constructors

GltfAnimationStartOptions

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

Public functions

copy

Added in 1.0.0-alpha13
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-alpha13
val seekStartTimeDuration

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 call GltfAnimation.seekTo to set the playhead to a valid position between seekStartTime and the duration.

shouldLoop

Added in 1.0.0-alpha13
val shouldLoopBoolean

Whether the animation plays in a loop.

speed

Added in 1.0.0-alpha13
val speedFloat

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.