import * as THREE from 'three'; import { Behavior, ContextManager, Observable, PlayOptions, Stream } from '@zcomponent/core'; import { GLTF } from '../components/models/GLTF'; /** * Represents the properties required to construct an Animation Behavior. */ export interface AnimationConstructorProps { /** * The name of the animation. * @zprop * @zvalues animations */ name: string; /** * Specifies whether the animation is additive. * @zprop * @zdefault false */ additive: boolean; /** * Specifies whether the animation should play at start. * @zprop * @zdefault false */ playAtStart: boolean; /** * The loop mode of the animation. * @zprop * @zdefault Once */ loop: Loop; } /** * Represents an Animation Behavior that can be applied to a GLTF object. * @zbehavior * @zparents three/Object3D/GLTF * @zicon directions_run * @zstream */ export declare class Animation extends Behavior implements Stream { protected constructorProps: AnimationConstructorProps; /** * The weight of the animation. * @zprop * @zdefault 1 * @ztype proportion */ weight: Observable; action: THREE.AnimationAction | undefined; clip: THREE.AnimationClip | undefined; /** * Constructs a new Animation Behavior. * @param contextManager The context manager. * @param instance The GLTF instance. * @param constructorProps The properties required to construct the Animation Behavior. */ constructor(contextManager: ContextManager, instance: GLTF, constructorProps: AnimationConstructorProps); /** * Plays the animation. * @param opts The play options. */ play(opts?: PlayOptions): void; /** * Pauses the animation. */ pause(): void; /** * Stops the animation. */ stop(): void; /** * Seeks to a specific time in the animation. * @param t The time to seek to in milliseconds. */ seek(t: number): void; /** * Returns the length of the animation in milliseconds. * @returns The length of the animation in milliseconds, or undefined if the animation clip is not defined. */ length(): number | undefined; private _update; private _initialize; } /** * The loop modes for the animation. */ export declare enum Loop { /** * The animation will loop once. */ Once = "Once", /** * The animation will repeat. */ Repeat = "Repeat", /** * The animation will play forward, then backward. */ PingPong = "PingPong" }