GltfAnimationStartOptions


@RequiresApi(value = 26)
public final class GltfAnimationStartOptions


Animation options for starting a GltfAnimation.

Throws
IllegalArgumentException

if seekStartTime is negative.

Summary

Public constructors

GltfAnimationStartOptions(
    boolean shouldLoop,
    float speed,
    @NonNull Duration seekStartTime
)

Public methods

final @NonNull GltfAnimationStartOptions
copy(boolean shouldLoop, float speed, @NonNull Duration seekStartTime)

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

boolean
equals(Object other)
final @NonNull Duration

The start offset.

final float

The playback rate.

int
final boolean

Whether the animation plays in a loop.

@NonNull String

Public constructors

GltfAnimationStartOptions

Added in 1.0.0-alpha13
public GltfAnimationStartOptions(
    boolean shouldLoop,
    float speed,
    @NonNull Duration seekStartTime
)

Public methods

copy

Added in 1.0.0-alpha13
public final @NonNull GltfAnimationStartOptions copy(boolean shouldLoop, float speed, @NonNull Duration seekStartTime)

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

equals

public boolean equals(Object other)

getSeekStartTime

Added in 1.0.0-alpha13
public final @NonNull Duration getSeekStartTime()

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.

getSpeed

Added in 1.0.0-alpha13
public final float getSpeed()

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

shouldLoop

Added in 1.0.0-alpha13
public final boolean shouldLoop()

Whether the animation plays in a loop.

toString

public @NonNull String toString()