the-world-engine
Version:
three.js based, unity like game engine for browser
138 lines (137 loc) • 4.03 kB
TypeScript
import { Component } from "../../hierarchy_object/Component";
import type { ReadonlyColor } from "../../render/ReadonlyColor";
/**
* caamera projection type
*/
export declare enum CameraType {
Perspective = 0,
Orthographic = 1
}
/**
* camera component
*
* it's a wrapper for `THREE.Camera`
*
* At least one camera component must exist in the scene
*/
export declare class Camera extends Component {
private _camera;
private _cameraType;
private _fov;
private _viewSize;
private _zoom;
private _near;
private _far;
private _priority;
private _backgroundColor;
private _cameraContainer;
private readonly onScreenResize;
awake(): void;
onEnable(): void;
onWorldMatrixUpdated(): void;
private createOrUpdateCamera;
private createNewPerspectiveCamera;
private createNewOrthographicCamera;
onDisable(): void;
onDestroy(): void;
/**
* camera projection type (default: `CameraType.Orthographic`)
*
* perspective: Camera will render objects with perspective intact
*
* orthographic: Camera will render objects uniformly, with no sense of perspective
*/
get cameraType(): CameraType;
/**
* camera projection type (default: `CameraType.Orthographic`)
*
* perspective: Camera will render objects with perspective intact
*
* orthographic: Camera will render objects uniformly, with no sense of perspective
*/
set cameraType(value: CameraType);
/**
* field of view (default: 75)
*
* only available when cameraType is Perspective
*/
get fov(): number;
/**
* field of view (default: 75)
*
* only available when cameraType is Perspective
*/
set fov(value: number);
/**
* view size (default: 5)
*
* only available when cameraType is Orthographic
*/
get viewSize(): number;
/**
* view size (default: 5)
*
* only available when cameraType is Orthographic
*/
set viewSize(value: number);
/**
* zoom (default: 1)
*/
get zoom(): number;
/**
* zoom (default: 1)
*/
set zoom(value: number);
/**
* near clipping plane (default: 0.1)
*
* this property is not available when using CssRenderer because css does not support frustum culling
*/
get near(): number;
/**
* near clipping plane (default: 0.1)
*
* this property is not available when using CssRenderer because css does not support frustum culling
*/
set near(value: number);
/**
* far clipping plane (default: 1000)
*
* this property is not available when using CssRenderer because css does not support frustum culling
*/
get far(): number;
/**
* far clipping plane (default: 1000)
*
* this property is not available when using CssRenderer because css does not support frustum culling
*/
set far(value: number);
/**
* priority of the camera (default: 0)
*
* If there are multiple cameras in the scene, higher priority cameras will be rendered
*/
get priority(): number;
/**
* priority of the camera (default: 0)
*
* If there are multiple cameras in the scene, higher priority cameras will be rendered
*/
set priority(value: number);
/**
* background color of the camera (default: null)
*
* This color will fill the empty space of the scene
*
* When used with WebGLRenderer, you can specify a texture background. And in the case of color, the alpha channel is ignored
*/
get backgroundColor(): null | ReadonlyColor | THREE.Texture;
/**
* background color of the camera (default: null)
*
* This color will fill the empty space of the scene
*
* When used with WebGLRenderer, you can specify a texture background. And in the case of color, the alpha channel is ignored
*/
set backgroundColor(value: null | ReadonlyColor | THREE.Texture);
}