@playcanvas/web-components 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,13 +43,13 @@ Or you can include it directly in your HTML file from a CDN.
43
43
  ES Modules:
44
44
 
45
45
  ```html
46
- <script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.5/dist/pwc.mjs"></script>
46
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.9/dist/pwc.mjs"></script>
47
47
  ```
48
48
 
49
49
  UMD:
50
50
 
51
51
  ```html
52
- <script src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.5"></script>
52
+ <script src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.9"></script>
53
53
  ```
54
54
 
55
55
  ## Tag Reference 📖
package/dist/app.d.ts CHANGED
@@ -14,6 +14,10 @@ declare class AppElement extends AsyncElement {
14
14
  private _stencil;
15
15
  private _highResolution;
16
16
  private _hierarchyReady;
17
+ private _picker;
18
+ private _hasPointerListeners;
19
+ private _hoveredEntity;
20
+ private _pointerHandlers;
17
21
  /**
18
22
  * The PlayCanvas application instance.
19
23
  */
@@ -27,6 +31,13 @@ declare class AppElement extends AsyncElement {
27
31
  connectedCallback(): Promise<void>;
28
32
  disconnectedCallback(): void;
29
33
  _onWindowResize(): void;
34
+ _pickerCreate(): void;
35
+ _pickerDestroy(): void;
36
+ _onPointerMove(event: PointerEvent): void;
37
+ _onPointerDown(event: PointerEvent): void;
38
+ _onPointerUp(event: PointerEvent): void;
39
+ _onPointerListenerAdded(type: string): void;
40
+ _onPointerListenerRemoved(type: string): void;
30
41
  /**
31
42
  * Sets the alpha flag.
32
43
  * @param value - The alpha flag.
@@ -17,12 +17,14 @@ declare class CameraComponentElement extends ComponentElement {
17
17
  private _flipFaces;
18
18
  private _fov;
19
19
  private _frustumCulling;
20
+ private _gamma;
20
21
  private _nearClip;
21
22
  private _orthographic;
22
23
  private _orthoHeight;
23
24
  private _priority;
24
25
  private _rect;
25
26
  private _scissorRect;
27
+ private _tonemap;
26
28
  /** @ignore */
27
29
  constructor();
28
30
  getInitialComponentData(): {
@@ -35,12 +37,14 @@ declare class CameraComponentElement extends ComponentElement {
35
37
  flipFaces: boolean;
36
38
  fov: number;
37
39
  frustumCulling: boolean;
40
+ gammaCorrection: number;
38
41
  nearClip: number;
39
42
  orthographic: boolean;
40
43
  orthoHeight: number;
41
44
  priority: number;
42
45
  rect: Vec4;
43
46
  scissorRect: Vec4;
47
+ toneMapping: number | undefined;
44
48
  };
45
49
  get xrAvailable(): boolean | null | undefined;
46
50
  startXr(type: 'immersive-ar' | 'immersive-vr', space: 'bounded-floor' | 'local' | 'local-floor' | 'unbounded' | 'viewer'): void;
@@ -140,6 +144,16 @@ declare class CameraComponentElement extends ComponentElement {
140
144
  * @returns The frustum culling.
141
145
  */
142
146
  get frustumCulling(): boolean;
147
+ /**
148
+ * Sets the gamma correction of the camera.
149
+ * @param value - The gamma correction.
150
+ */
151
+ set gamma(value: 'none' | 'srgb');
152
+ /**
153
+ * Gets the gamma correction of the camera.
154
+ * @returns The gamma correction.
155
+ */
156
+ get gamma(): 'none' | 'srgb';
143
157
  /**
144
158
  * Sets the near clip distance of the camera.
145
159
  * @param value - The near clip distance.
@@ -200,6 +214,16 @@ declare class CameraComponentElement extends ComponentElement {
200
214
  * @returns The scissor rect.
201
215
  */
202
216
  get scissorRect(): Vec4;
217
+ /**
218
+ * Sets the tone mapping of the camera.
219
+ * @param value - The tone mapping.
220
+ */
221
+ set tonemap(value: 'none' | 'linear' | 'filmic' | 'hejl' | 'aces' | 'aces2' | 'neutral');
222
+ /**
223
+ * Gets the tone mapping of the camera.
224
+ * @returns The tone mapping.
225
+ */
226
+ get tonemap(): 'none' | 'linear' | 'filmic' | 'hejl' | 'aces' | 'aces2' | 'neutral';
203
227
  static get observedAttributes(): string[];
204
228
  attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
205
229
  }
@@ -17,8 +17,11 @@ declare class LightComponentElement extends ComponentElement {
17
17
  private _range;
18
18
  private _shadowBias;
19
19
  private _shadowDistance;
20
+ private _shadowIntensity;
20
21
  private _shadowResolution;
22
+ private _shadowType;
21
23
  private _type;
24
+ private _vsmBias;
22
25
  /** @ignore */
23
26
  constructor();
24
27
  getInitialComponentData(): {
@@ -31,8 +34,11 @@ declare class LightComponentElement extends ComponentElement {
31
34
  range: number;
32
35
  shadowBias: number;
33
36
  shadowDistance: number;
37
+ shadowIntensity: number;
34
38
  shadowResolution: number;
39
+ shadowType: number | undefined;
35
40
  type: string;
41
+ vsmBias: number;
36
42
  };
37
43
  /**
38
44
  * Gets the light component.
@@ -129,6 +135,16 @@ declare class LightComponentElement extends ComponentElement {
129
135
  * @returns The shadow distance.
130
136
  */
131
137
  get shadowDistance(): number;
138
+ /**
139
+ * Sets the shadow intensity of the light.
140
+ * @param value - The shadow intensity.
141
+ */
142
+ set shadowIntensity(value: number);
143
+ /**
144
+ * Gets the shadow intensity of the light.
145
+ * @returns The shadow intensity.
146
+ */
147
+ get shadowIntensity(): number;
132
148
  /**
133
149
  * Sets the shadow resolution of the light.
134
150
  * @param value - The shadow resolution.
@@ -139,6 +155,26 @@ declare class LightComponentElement extends ComponentElement {
139
155
  * @returns The shadow resolution.
140
156
  */
141
157
  get shadowResolution(): number;
158
+ /**
159
+ * Sets the shadow type of the light.
160
+ * @param value - The shadow type. Can be:
161
+ *
162
+ * - `pcf1-16f` - 1-tap percentage-closer filtered shadow map with 16-bit depth.
163
+ * - `pcf1-32f` - 1-tap percentage-closer filtered shadow map with 32-bit depth.
164
+ * - `pcf3-16f` - 3-tap percentage-closer filtered shadow map with 16-bit depth.
165
+ * - `pcf3-32f` - 3-tap percentage-closer filtered shadow map with 32-bit depth.
166
+ * - `pcf5-16f` - 5-tap percentage-closer filtered shadow map with 16-bit depth.
167
+ * - `pcf5-32f` - 5-tap percentage-closer filtered shadow map with 32-bit depth.
168
+ * - `vsm-16f` - Variance shadow map with 16-bit depth.
169
+ * - `vsm-32f` - Variance shadow map with 32-bit depth.
170
+ * - `pcss-32f` - Percentage-closer soft shadow with 32-bit depth.
171
+ */
172
+ set shadowType(value: 'pcf1-16f' | 'pcf1-32f' | 'pcf3-16f' | 'pcf3-32f' | 'pcf5-16f' | 'pcf5-32f' | 'vsm-16f' | 'vsm-32f' | 'pcss-32f');
173
+ /**
174
+ * Gets the shadow type of the light.
175
+ * @returns The shadow type.
176
+ */
177
+ get shadowType(): "pcf1-16f" | "pcf1-32f" | "pcf3-16f" | "pcf3-32f" | "pcf5-16f" | "pcf5-32f" | "vsm-16f" | "vsm-32f" | "pcss-32f";
142
178
  /**
143
179
  * Sets the type of the light.
144
180
  * @param value - The type.
@@ -149,6 +185,16 @@ declare class LightComponentElement extends ComponentElement {
149
185
  * @returns The type.
150
186
  */
151
187
  get type(): string;
188
+ /**
189
+ * Sets the VSM bias of the light.
190
+ * @param value - The VSM bias.
191
+ */
192
+ set vsmBias(value: number);
193
+ /**
194
+ * Gets the VSM bias of the light.
195
+ * @returns The VSM bias.
196
+ */
197
+ get vsmBias(): number;
152
198
  static get observedAttributes(): string[];
153
199
  attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
154
200
  }
@@ -18,7 +18,7 @@ declare class SoundComponentElement extends ComponentElement {
18
18
  /** @ignore */
19
19
  constructor();
20
20
  getInitialComponentData(): {
21
- distanceModel: "exponential" | "inverse" | "linear";
21
+ distanceModel: "linear" | "exponential" | "inverse";
22
22
  maxDistance: number;
23
23
  pitch: number;
24
24
  positional: boolean;
package/dist/entity.d.ts CHANGED
@@ -30,6 +30,10 @@ declare class EntityElement extends AsyncElement {
30
30
  * The tags of the entity.
31
31
  */
32
32
  private _tags;
33
+ /**
34
+ * The pointer event listeners for the entity.
35
+ */
36
+ private _listeners;
33
37
  /**
34
38
  * The PlayCanvas entity instance.
35
39
  */
@@ -100,5 +104,8 @@ declare class EntityElement extends AsyncElement {
100
104
  get tags(): string[];
101
105
  static get observedAttributes(): string[];
102
106
  attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
107
+ addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
108
+ removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void;
109
+ hasListeners(type: string): boolean;
103
110
  }
104
111
  export { EntityElement };
package/dist/fog.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ import { Color } from 'playcanvas';
2
+ /**
3
+ * The FogElement interface provides properties and methods for manipulating
4
+ * `<pc-fog>` elements. The FogElement interface also inherits the properties and
5
+ * methods of the {@link HTMLElement} interface.
6
+ */
7
+ declare class FogElement extends HTMLElement {
8
+ private _color;
9
+ private _density;
10
+ private _end;
11
+ private _start;
12
+ private _type;
13
+ private dispatchFogUpdate;
14
+ set color(value: Color);
15
+ get color(): Color;
16
+ set density(value: number);
17
+ get density(): number;
18
+ set end(value: number);
19
+ get end(): number;
20
+ set start(value: number);
21
+ get start(): number;
22
+ set type(value: 'linear' | 'exp' | 'exp2');
23
+ get type(): 'linear' | 'exp' | 'exp2';
24
+ static get observedAttributes(): string[];
25
+ attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
26
+ constructor();
27
+ }
28
+ export { FogElement };