UNPKG

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.

82 lines 2.66 kB
import { Spherical } from 'three'; import { AViewerPluginSync, ThreeViewer } from '../../viewer'; /** * Interaction Prompt Plugin * * A plugin that adds a hand pointer icon over the canvas that moves to prompt the user to interact with the 3d scene. * Pointer icon from [google/model-viewer](https://github.com/google/model-viewer) * * The pointer is automatically shown when some object is in the scene and the camera is not moving. * The animation starts after a delay and stops on user interaction. It then restarts after a delay after the user stops interacting * * The plugin provides several options and functions to configure the automatic behaviour or trigger the animation manually. * TODO - create example * @category Plugins */ export declare class InteractionPromptPlugin extends AViewerPluginSync { static readonly PluginType = "InteractionPromptPlugin"; enabled: boolean; currentSphericalPosition?: Spherical; animationRunning: boolean; cursorEl?: HTMLElement; /** * Animation duration in ms */ animationDuration: number; /** * Animation distance in pixels */ animationDistance: number; animationPauseDuration: number; /** * Camera Rotation distance in radians. */ rotationDistance: number; /** * Move the pointer icon up or down. * Y offset in the range -1 to 1. * 0 is the center of the screen, -1 is the top and 1 is the bottom. */ yOffset: number; /** * Autostart after camera stop */ autoStart: boolean; /** * Time in ms to wait before auto start after the camera stops. */ autoStartDelay: number; /** * Auto stop on user interaction pointer down or wheel */ autoStop: boolean; /** * Auto start on scene object load. This requires {@link autoStart} to be true */ autoStartOnObjectLoad: boolean; autoStartOnObjectLoadDelay: number; currentTime: number; lastActionTime: number; constructor(enabled?: boolean); /** * Pointer icon svg * Note: This is directly added to the DOM */ pointerIcon: string; onAdded(viewer: ThreeViewer): void; onRemove(viewer: ThreeViewer): void; private _mainCameraUpdate; private _addSceneObject; protected _pointerIconChanged(): void; private _initializeCursor; onlyOnOrbitControls: boolean; private _orbitWarning; startAnimation: () => void; stopAnimation: ({ reset }?: { reset?: boolean; }) => Promise<unknown>; private _pointerDown; private _x; private _preFrame; } //# sourceMappingURL=InteractionPromptPlugin.d.ts.map