@playcanvas/web-components
Version:
Web Components for the PlayCanvas Engine
215 lines (214 loc) • 6.63 kB
TypeScript
import { Color, LightComponent } from 'playcanvas';
import { ComponentElement } from './component';
/**
* The LightComponentElement interface provides properties and methods for manipulating
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-light/ | `<pc-light>`} elements.
* The LightComponentElement interface also inherits the properties and methods of the
* {@link HTMLElement} interface.
*
* @category Components
*/
declare class LightComponentElement extends ComponentElement {
private _castShadows;
private _color;
private _innerConeAngle;
private _intensity;
private _normalOffsetBias;
private _outerConeAngle;
private _range;
private _shadowBias;
private _shadowDistance;
private _shadowIntensity;
private _shadowResolution;
private _shadowType;
private _type;
private _vsmBias;
private _vsmBlurSize;
/** @ignore */
constructor();
getInitialComponentData(): {
castShadows: boolean;
color: Color;
innerConeAngle: number;
intensity: number;
normalOffsetBias: number;
outerConeAngle: number;
range: number;
shadowBias: number;
shadowDistance: number;
shadowIntensity: number;
shadowResolution: number;
shadowType: 0 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined;
type: string;
vsmBias: number;
vsmBlurSize: number;
};
/**
* Gets the underlying PlayCanvas light component.
* @returns The light component.
*/
get component(): LightComponent | null;
/**
* Sets the cast shadows flag of the light.
* @param value - The cast shadows flag.
*/
set castShadows(value: boolean);
/**
* Gets the cast shadows flag of the light.
* @returns The cast shadows flag.
*/
get castShadows(): boolean;
/**
* Sets the color of the light.
* @param value - The color.
*/
set color(value: Color);
/**
* Gets the color of the light.
* @returns The color.
*/
get color(): Color;
/**
* Sets the inner cone angle of the light.
* @param value - The inner cone angle.
*/
set innerConeAngle(value: number);
/**
* Gets the inner cone angle of the light.
* @returns The inner cone angle.
*/
get innerConeAngle(): number;
/**
* Sets the intensity of the light.
* @param value - The intensity.
*/
set intensity(value: number);
/**
* Gets the intensity of the light.
* @returns The intensity.
*/
get intensity(): number;
/**
* Sets the normal offset bias of the light.
* @param value - The normal offset bias.
*/
set normalOffsetBias(value: number);
/**
* Gets the normal offset bias of the light.
* @returns The normal offset bias.
*/
get normalOffsetBias(): number;
/**
* Sets the outer cone angle of the light.
* @param value - The outer cone angle.
*/
set outerConeAngle(value: number);
/**
* Gets the outer cone angle of the light.
* @returns The outer cone angle.
*/
get outerConeAngle(): number;
/**
* Sets the range of the light.
* @param value - The range.
*/
set range(value: number);
/**
* Gets the range of the light.
* @returns The range.
*/
get range(): number;
/**
* Sets the shadow bias of the light.
* @param value - The shadow bias.
*/
set shadowBias(value: number);
/**
* Gets the shadow bias of the light.
* @returns The shadow bias.
*/
get shadowBias(): number;
/**
* Sets the shadow distance of the light.
* @param value - The shadow distance.
*/
set shadowDistance(value: number);
/**
* Gets the shadow distance of the light.
* @returns The shadow distance.
*/
get shadowDistance(): number;
/**
* Sets the shadow intensity of the light.
* @param value - The shadow intensity.
*/
set shadowIntensity(value: number);
/**
* Gets the shadow intensity of the light.
* @returns The shadow intensity.
*/
get shadowIntensity(): number;
/**
* Sets the shadow resolution of the light.
* @param value - The shadow resolution.
*/
set shadowResolution(value: number);
/**
* Gets the shadow resolution of the light.
* @returns The shadow resolution.
*/
get shadowResolution(): number;
/**
* Sets the shadow type of the light.
* @param value - The shadow type. Can be:
*
* - `pcf1-16f` - 1-tap percentage-closer filtered shadow map with 16-bit depth.
* - `pcf1-32f` - 1-tap percentage-closer filtered shadow map with 32-bit depth.
* - `pcf3-16f` - 3-tap percentage-closer filtered shadow map with 16-bit depth.
* - `pcf3-32f` - 3-tap percentage-closer filtered shadow map with 32-bit depth.
* - `pcf5-16f` - 5-tap percentage-closer filtered shadow map with 16-bit depth.
* - `pcf5-32f` - 5-tap percentage-closer filtered shadow map with 32-bit depth.
* - `vsm-16f` - Variance shadow map with 16-bit depth.
* - `vsm-32f` - Variance shadow map with 32-bit depth.
* - `pcss-32f` - Percentage-closer soft shadow with 32-bit depth.
*/
set shadowType(value: 'pcf1-16f' | 'pcf1-32f' | 'pcf3-16f' | 'pcf3-32f' | 'pcf5-16f' | 'pcf5-32f' | 'vsm-16f' | 'vsm-32f' | 'pcss-32f');
/**
* Gets the shadow type of the light.
* @returns The shadow type.
*/
get shadowType(): "pcf1-16f" | "pcf1-32f" | "pcf3-16f" | "pcf3-32f" | "pcf5-16f" | "pcf5-32f" | "vsm-16f" | "vsm-32f" | "pcss-32f";
/**
* Sets the type of the light.
* @param value - The type.
*/
set type(value: string);
/**
* Gets the type of the light.
* @returns The type.
*/
get type(): string;
/**
* Sets the VSM bias of the light.
* @param value - The VSM bias.
*/
set vsmBias(value: number);
/**
* Gets the VSM bias of the light.
* @returns The VSM bias.
*/
get vsmBias(): number;
/**
* Sets the VSM blur size of the light. Minimum is 1, maximum is 25. Default is 11.
* @param value - The VSM blur size.
*/
set vsmBlurSize(value: number);
/**
* Gets the VSM blur size of the light.
* @returns The VSM blur size.
*/
get vsmBlurSize(): number;
static get observedAttributes(): string[];
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
}
export { LightComponentElement };