threepipe
Version:
A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.
46 lines • 1.72 kB
TypeScript
import { Quaternion, Vector3 } from 'three';
import { AViewerPluginSync, ThreeViewer } from '../../viewer';
import { PopmotionPlugin } from './PopmotionPlugin';
import { IObject3D } from '../../core';
export interface TSavedTransform {
position: Vector3;
quaternion: Quaternion;
scale: Vector3;
name?: string;
}
/**
* Transform Animation Plugin
*
* Helper plugin to save, load and animate between different transforms(position, rotation, scale) on objects.
* Also adds a UI to add and animate transforms on objects.
* Requires the PopmotionPlugin to animate.
*
* @category Plugins
*/
export declare class TransformAnimationPlugin extends AViewerPluginSync {
static readonly PluginType = "TransformAnimationPlugin";
toJSON: any;
enabled: boolean;
dependencies: (typeof PopmotionPlugin)[];
constructor();
onAdded(viewer: ThreeViewer): void;
onRemove(viewer: ThreeViewer): void;
private _addSceneObject;
addTransform(o: IObject3D, name?: string): {
name: string;
position: Vector3;
quaternion: Quaternion;
scale: Vector3;
};
setTransform(o: IObject3D, tr: TSavedTransform | number | string): void;
getSavedTransform(tr: TSavedTransform | number | string, o: IObject3D): TSavedTransform | undefined;
animateTransform(o: IObject3D, tr: TSavedTransform | number | string, duration?: number): import('./PopmotionPlugin').AnimationResult | undefined;
}
declare module '../../core/IObject' {
interface IObject3DUserData {
[TransformAnimationPlugin.PluginType]?: {
transforms: TSavedTransform[];
};
}
}
//# sourceMappingURL=../../src/plugins/animation/TransformAnimationPlugin.d.ts.map