UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

65 lines (64 loc) 2.23 kB
import { type Behavior } from "../behavior.js"; import { EasingFunction } from "../../Animations/easing.js"; import { type Nullable } from "../../types.js"; import { Animation } from "../../Animations/animation.js"; import { type Camera } from "../../Cameras/camera.js"; import { type IColor3Like, type IColor4Like, type IMatrixLike, type IQuaternionLike, type IVector2Like, type IVector3Like } from "../../Maths/math.like.js"; export type AllowedAnimValue = number | IVector2Like | IVector3Like | IQuaternionLike | IMatrixLike | IColor3Like | IColor4Like | SizeLike | undefined; /** * Animate camera property changes with an interpolation effect * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors */ export declare class InterpolatingBehavior<C extends Camera = Camera> implements Behavior<C> { /** * Gets the name of the behavior. */ get name(): string; /** * The easing function to use for interpolation */ easingFunction: EasingFunction; /** * The easing mode (default is EASINGMODE_EASEINOUT) */ easingMode: number; /** * Duration of the animation in milliseconds */ transitionDuration: number; /** * Attached node of this behavior */ get attachedNode(): Nullable<C>; private _attachedCamera; private _animatables; private _promiseResolve?; /** * Initializes the behavior */ constructor(); /** * Initializes the behavior */ init(): void; /** * Attaches the behavior to a camera * @param camera The camera to attach to */ attach(camera: C): void; /** * Detaches the behavior from the camera */ detach(): void; get isInterpolating(): boolean; /** * Stops and removes all animations */ stopAllAnimations(): void; updateProperties<K extends keyof C>(properties: Map<K, AllowedAnimValue>): void; animatePropertiesAsync<K extends keyof C>(properties: Map<K, AllowedAnimValue>, transitionDuration?: number, easingFn?: EasingFunction, updateAnimation?: (key: string, animation: Animation) => void): Promise<void>; } export type SizeLike = { width: number; height: number; };