@playcanvas/web-components
Version:
Web Components for the PlayCanvas Engine
253 lines (252 loc) • 7.52 kB
TypeScript
import { CameraComponent, Color, Vec4 } from 'playcanvas';
import { ComponentElement } from './component';
/**
* The CameraComponentElement interface provides properties and methods for manipulating
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-camera/ | `<pc-camera>`} elements.
* The CameraComponentElement interface also inherits the properties and methods of the
* {@link HTMLElement} interface.
*
* @category Components
*/
declare class CameraComponentElement extends ComponentElement {
private _clearColor;
private _clearColorBuffer;
private _clearDepthBuffer;
private _clearStencilBuffer;
private _cullFaces;
private _farClip;
private _flipFaces;
private _fov;
private _frustumCulling;
private _gamma;
private _horizontalFov;
private _nearClip;
private _orthographic;
private _orthoHeight;
private _priority;
private _rect;
private _scissorRect;
private _tonemap;
/** @ignore */
constructor();
getInitialComponentData(): {
clearColor: Color;
clearColorBuffer: boolean;
clearDepthBuffer: boolean;
clearStencilBuffer: boolean;
cullFaces: boolean;
farClip: number;
flipFaces: boolean;
fov: number;
frustumCulling: boolean;
gammaCorrection: 0 | 1;
horizontalFov: boolean;
nearClip: number;
orthographic: boolean;
orthoHeight: number;
priority: number;
rect: Vec4;
scissorRect: Vec4;
toneMapping: 0 | 2 | 1 | 3 | 4 | 5 | 6 | undefined;
};
get xrAvailable(): boolean | null | undefined;
/**
* Starts the camera in XR mode.
* @param type - The type of XR mode to start.
* @param space - The space to start the camera in.
*/
startXr(type: 'immersive-ar' | 'immersive-vr', space: 'bounded-floor' | 'local' | 'local-floor' | 'unbounded' | 'viewer'): void;
/**
* Ends the camera's XR mode.
*/
endXr(): void;
/**
* Gets the underlying PlayCanvas camera component.
* @returns The camera component.
*/
get component(): CameraComponent | null;
/**
* Sets the clear color of the camera.
* @param value - The clear color.
*/
set clearColor(value: Color);
/**
* Gets the clear color of the camera.
* @returns The clear color.
*/
get clearColor(): Color;
/**
* Sets the clear color buffer of the camera.
* @param value - The clear color buffer.
*/
set clearColorBuffer(value: boolean);
/**
* Gets the clear color buffer of the camera.
* @returns The clear color buffer.
*/
get clearColorBuffer(): boolean;
/**
* Sets the clear depth buffer of the camera.
* @param value - The clear depth buffer.
*/
set clearDepthBuffer(value: boolean);
/**
* Gets the clear depth buffer of the camera.
* @returns The clear depth buffer.
*/
get clearDepthBuffer(): boolean;
/**
* Sets the clear stencil buffer of the camera.
* @param value - The clear stencil buffer.
*/
set clearStencilBuffer(value: boolean);
/**
* Gets the clear stencil buffer of the camera.
* @returns The clear stencil buffer.
*/
get clearStencilBuffer(): boolean;
/**
* Sets the cull faces of the camera.
* @param value - The cull faces.
*/
set cullFaces(value: boolean);
/**
* Gets the cull faces of the camera.
* @returns The cull faces.
*/
get cullFaces(): boolean;
/**
* Sets the far clip distance of the camera.
* @param value - The far clip distance.
*/
set farClip(value: number);
/**
* Gets the far clip distance of the camera.
* @returns The far clip distance.
*/
get farClip(): number;
/**
* Sets the flip faces of the camera.
* @param value - The flip faces.
*/
set flipFaces(value: boolean);
/**
* Gets the flip faces of the camera.
* @returns The flip faces.
*/
get flipFaces(): boolean;
/**
* Sets the field of view of the camera.
* @param value - The field of view.
*/
set fov(value: number);
/**
* Gets the field of view of the camera.
* @returns The field of view.
*/
get fov(): number;
/**
* Sets the frustum culling of the camera.
* @param value - The frustum culling.
*/
set frustumCulling(value: boolean);
/**
* Gets the frustum culling of the camera.
* @returns The frustum culling.
*/
get frustumCulling(): boolean;
/**
* Sets the gamma correction of the camera.
* @param value - The gamma correction.
*/
set gamma(value: 'linear' | 'srgb');
/**
* Gets the gamma correction of the camera.
* @returns The gamma correction.
*/
get gamma(): 'linear' | 'srgb';
/**
* Sets whether the camera's field of view (fov) is horizontal or vertical. Defaults to false
* (meaning it is vertical be default).
* @param value - Whether the camera's field of view is horizontal.
*/
set horizontalFov(value: boolean);
/**
* Gets whether the camera's field of view (fov) is horizontal or vertical.
* @returns Whether the camera's field of view is horizontal.
*/
get horizontalFov(): boolean;
/**
* Sets the near clip distance of the camera.
* @param value - The near clip distance.
*/
set nearClip(value: number);
/**
* Gets the near clip distance of the camera.
* @returns The near clip distance.
*/
get nearClip(): number;
/**
* Sets the orthographic projection of the camera.
* @param value - The orthographic projection.
*/
set orthographic(value: boolean);
/**
* Gets the orthographic projection of the camera.
* @returns The orthographic projection.
*/
get orthographic(): boolean;
/**
* Sets the orthographic height of the camera.
* @param value - The orthographic height.
*/
set orthoHeight(value: number);
/**
* Gets the orthographic height of the camera.
* @returns The orthographic height.
*/
get orthoHeight(): number;
/**
* Sets the priority of the camera.
* @param value - The priority.
*/
set priority(value: number);
/**
* Gets the priority of the camera.
* @returns The priority.
*/
get priority(): number;
/**
* Sets the rect of the camera.
* @param value - The rect.
*/
set rect(value: Vec4);
/**
* Gets the rect of the camera.
* @returns The rect.
*/
get rect(): Vec4;
/**
* Sets the scissor rect of the camera.
* @param value - The scissor rect.
*/
set scissorRect(value: Vec4);
/**
* Gets the scissor rect of the camera.
* @returns The scissor rect.
*/
get scissorRect(): Vec4;
/**
* Sets the tone mapping of the camera.
* @param value - The tone mapping.
*/
set tonemap(value: 'none' | 'linear' | 'filmic' | 'hejl' | 'aces' | 'aces2' | 'neutral');
/**
* Gets the tone mapping of the camera.
* @returns The tone mapping.
*/
get tonemap(): 'none' | 'linear' | 'filmic' | 'hejl' | 'aces' | 'aces2' | 'neutral';
static get observedAttributes(): string[];
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
}
export { CameraComponentElement };