UNPKG

@3dverse/livelink-camera-controls

Version:

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.

44 lines (43 loc) 1.6 kB
import { CameraControls } from 'CameraControls'; import { Clock } from 'three'; export declare class KeyboardFlyControls { /** * Init that once and for all because hold-event lib has not been written to destroy KeyboardKeyHold objects * n.b: there are document and window event listeners in the KeyboardKeyHold constructor which are never * removed, and cannot be from outside because those listeners are local functions in the constructor. * https://github.com/yomotsu/hold-event/blob/master/src/KeyboardKeyHold.ts#L30 * TODO: rewrite this lib which is not maintained and buggy. */ private static _keys; private _cameraControls; private _clock; /** * A speed factor to adjust movement speed */ speedMultiplier: number; /** * Creates a `KeyboardFlyControls` instance. * * Sample: * ``` * CameraControls.install( { THREE } ); * const cameraControls = new CameraControls( camera, domElement ); * const KeyboardFlyControls= new KeyboardFlyControls( cameraControls ); * ``` * * @param cameraControls A `CameraConrols` to bind keyboard on. * @param clock A `THREE.Clock` used by to update `CameraConrols`. * @category Constructor */ constructor(cameraControls: CameraControls, clock: Clock); dispose(): void; enable(): void; disable(): void; private _truckLeft; private _truckRight; private _moveUp; private _moveDown; private _moveFront; private _moveBack; private _updateClock; }