import type { ControlsType, Object3D, PerspectiveCamera, SceneControl } from '@anov/3d-core'; import { EventDispatcher, Vector3 } from '@anov/3d-core'; import type { CameraExpandInterface, FollowParamsOption, vector3Array } from '.'; /** * CameraExpand, 主要提供了一些PerspectiveCamera的拓展能力 */ export declare class PerspectiveCameraExpand extends EventDispatcher implements CameraExpandInterface { private _isTransitionPeriod; private camera; private controls; private sceneControl; private tween; private _isCameraChange; private followId; private followCancelMap; constructor(camera: PerspectiveCamera, controls: ControlsType, sceneControl: SceneControl); get isTransitionPeriod(): boolean; get isCameraChange(): boolean; private bindEvent; /** * calculate last position from position box * if distance is not defined, calculate distance from box size * @param currentPos * @param distanceCoefficient * @param distance * @returns */ private caclCurrentPos; /** * caclSingleCoordinate, when use focus and target is single point * @param prevTarget * @param prevPosition * @param lastTarget * @returns */ private caclSingleCoordinate; /** * camera focus * @param params * @returns */ focus(params: { target: vector3Array | vector3Array[] | string; pitch?: number; yaw?: number; distance?: number; duration?: number; isTrigger?: boolean; distanceCoefficient?: number; onUpdate?: (args: { position: Vector3; target: Vector3; }) => void; }): Promise<{ position: number[]; target: number[]; duration: number; userInput: boolean; pitch: number; }>; /** * set camera, main set position and target * @param params * @returns */ set(params: { position: vector3Array; target: vector3Array; isTrigger?: boolean; duration?: number; onUpdate?: (args: { position: Vector3; target: Vector3; }) => void; }): Promise<{ position: number[]; target: number[]; isTrigger: boolean; duration: number; userInput: boolean; }>; /** * get camera position and target * @returns */ get(): { position: number[]; target: number[]; }; /** * get current pitch */ get pitch(): number; /** * get current yaw * @returns */ get yaw(): number; /** * set pitch, similar to ue * @param deg */ setPitch(deg: number): void; /** * set yaw, similar to ue * @param deg */ setYaw(deg: number): void; /** * cacl Position By Follow * @param pitch * @param yaw * @param distance * @returns */ private caclPositionByFollow; /** * follow 3d object, not only use in camera * @param target * @param camera * @param option * @returns */ follow(target: Object3D, camera: PerspectiveCamera, option?: FollowParamsOption): number; /** * cancel follow * @param followId */ cancelFollow(followId: number): void; /** * cancel all follow */ cancelAllFollow(): void; /** * interpolation move camera * @param position * @param target * @param pitch * @param yaw * @param options * @returns */ private motion; }