the-world-engine
Version:
three.js based, unity like game engine for browser
75 lines (74 loc) • 2.52 kB
TypeScript
import type { IEventContainer } from "../collection/EventContainer";
import type { Camera } from "../script/render/Camera";
import type { CameraInfo } from "./CameraInfo";
import type { ReadonlyColor } from "./ReadonlyColor";
/**
* The container that has the camera currently in use for rendering.
*
* you can use Unsafe API by casting this to `CameraContainer`
*/
export interface IReadonlyCameraContainer {
/**
* get current render camera
*/
get camera(): Camera | null;
}
/**
* schedule camera by priority to be rendered
* do not drive this class
*/
export declare class CameraContainer {
private _currentCameraInfo;
private readonly _cameraInfoMap;
private readonly _cameraQueue;
private readonly _onChangeBackgroundColor;
private readonly _onCameraChangedEvent;
/**
* get current render camera
*/
get camera(): Camera | null;
/**
* get current camera priority
*
* This is the API used to make wrapper of three.js Camera
* There is no use unless you use raw three.js objects that are not managed by the engine
*/
get currentCameraPriority(): number;
/**
* add new camera to camera container
* @param camera
* @param info
*
* This is the API used to make wrapper of three.js Camera
* There is no use unless you use raw three.js objects that are not managed by the engine
*/
addCamera(camera: Camera, info: CameraInfo): void;
/**
* remove camera from camera container
* @param camera
*
* This is the API used to make wrapper of three.js Camera
* There is no use unless you use raw three.js objects that are not managed by the engine
*/
removeCamera(camera: Camera): void;
/**
* change camera priority
* @param camera
* @param priority
*
* This is the API used to make wrapper of three.js Camera
* There is no use unless you use raw three.js objects that are not managed by the engine
*/
changeCameraPriority(camera: Camera, priority: number): void;
/**
* change camera background color
* @param camera
* @param color
*
* This is the API used to make wrapper of three.js Camera
* There is no use unless you use raw three.js objects that are not managed by the engine
*/
changeCameraBackgroundColor(camera: Camera, color: null | ReadonlyColor | THREE.Texture): void;
private setCamera;
get onCameraChanged(): IEventContainer<(camera: Camera) => void>;
}