You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.1 KiB

4 months ago
import type { RuntimeContext } from '../runtime/types';
import type { BasePluginOptions } from './base-plugin';
import { BasePlugin } from './base-plugin';
export interface CameraSettingOptions extends BasePluginOptions {
/**
* <zh/> 3D
* - `'perspective'` :
* - `'orthographic'` :
*
* <en/> Projection mode, perspective projection is only valid in 3D scenes
* - `'perspective'` : perspective projection
* - `'orthographic'` : Orthogonal projection
*/
projectionMode?: 'perspective' | 'orthographic';
/**
* <zh/>
* - `'orbiting'`:
* - `'exploring'`: orbiting
* - `'tracking'`:
*
* <en/> Camera type
* - `'orbiting'`: Fixed viewpoint, change camera position
* - `'exploring'`: Similar to orbiting, but allows the camera to rotate between the North Pole and the South Pole
* - `'tracking'`: Fixed camera position, change viewpoint
*/
cameraType?: 'orbiting' | 'exploring' | 'tracking';
/**
* <zh/>
*
* <en/> The position of the near plane
*/
near?: number;
/**
* <zh/>
*
* <en/> The position of the far plane
*/
far?: number;
/**
* <zh/>
*
* <en/> Camera field of view, only valid in perspective camera
*/
fov?: number;
/**
* <zh/>
* - number :
* - `'auto'` :
*
* <en/> Camera viewport aspect ratio, only valid in perspective camera.
* - number : Specific aspect ratio
* - `'auto'` : Automatically set to the aspect ratio of the canvas
*/
aspect?: number | 'auto';
/**
* <zh/>
*
* <en/> The distance from the camera to the target
* @defaultValue 500
*/
distance?: number;
/**
* <zh/>
*
* <en/> Minimum distance
*/
minDistance?: number;
/**
* <zh/>
*
* <en/> Maximum distance
*/
maxDistance?: number;
/**
* <zh/>
*
* <en/> Roll
*/
roll?: number;
/**
* <zh/>
*
* <en/> Elevation
*/
elevation?: number;
/**
* <zh/>
*
* <en/> Azimuth
*/
azimuth?: number;
}
/**
* <zh/>
*
* <en/> Configure camera parameters
*/
export declare class CameraSetting extends BasePlugin<CameraSettingOptions> {
constructor(context: RuntimeContext, options: CameraSettingOptions);
/**
* <zh/>
*
* <en/> Update camera parameters
* @param options - <zh/> | <en/> Camera configuration options
* @internal
*/
update(options: Partial<CameraSettingOptions>): void;
private bindEvents;
private setOptions;
private getCanvasAspect;
}