UNPKG

@3dverse/livelink-camera-controls

Version:

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

109 lines (108 loc) 2.9 kB
import * as THREE from 'threejs-math'; import { Components } from '@3dverse/livelink.core'; /** * */ export declare abstract class Camera { position: THREE.Vector3; quaternion: THREE.Quaternion; up: THREE.Vector3; scale: THREE.Vector3; /** * Local transform matrix */ matrix: THREE.Matrix4; /** * Global transform matrix */ matrixWorld: THREE.Matrix4; /** * This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera. */ matrixWorldInverse: THREE.Matrix4; /** * This is the matrix which contains the projection. */ projectionMatrix: THREE.Matrix4; /** * The inverse of projectionMatrix. */ projectionMatrixInverse: THREE.Matrix4; /** * Gets or sets the zoom factor of the camera. */ zoom: number; /** * When this is set, it calculates the matrixWorld in that frame and resets this property to false */ matrixWorldNeedsUpdate: boolean; /** * When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. */ matrixAutoUpdate: boolean; /** * If set, then the renderer checks every frame if the object and its children need matrix updates. * When it isn't, then you have to maintain all matrices in the object and its children yourself. */ matrixWorldAutoUpdate: boolean; /** * */ constructor(localTransform: Components.LocalTransform); /** * */ updateMatrix(): void; /** * */ updateMatrixWorld(force?: boolean): void; /** * */ lookAt(target: THREE.Vector3): void; /** * */ abstract updateProjectionMatrix(aspectRatio: number): void; } /** * */ export declare class PerspectiveCamera extends Camera { lens: Components.PerspectiveLens; /** * */ constructor(localTransform: Components.LocalTransform, lens: Components.PerspectiveLens, aspectRatio: number); /** * */ updateProjectionMatrix(aspectRatio: number): void; } export declare class OrthographicCamera extends Camera { lens: Components.OrthographicLens; left: number; right: number; top: number; bottom: number; /** * */ constructor(localTransform: Components.LocalTransform, lens: Components.OrthographicLens, aspectRatio: number); /** * */ /** * */ updateProjectionMatrix(aspectRatio: number): void; } /** * */ export declare function isPerspectiveCamera(camera: Camera): camera is PerspectiveCamera; /** * */ export declare function isOrthographicCamera(camera: Camera): camera is OrthographicCamera;