@playcanvas/web-components 0.2.3 → 0.2.5
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/dist/components/light-component.d.ts +12 -0
- package/dist/pwc.cjs +31 -5
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +31 -5
- package/dist/pwc.js.map +1 -1
- package/dist/pwc.min.js +1 -1
- package/dist/pwc.min.js.map +1 -1
- package/dist/pwc.mjs +31 -5
- package/dist/pwc.mjs.map +1 -1
- package/package.json +9 -9
- package/src/asset.ts +1 -1
- package/src/components/light-component.ts +28 -2
- package/src/components/sound-slot.ts +5 -3
- package/src/sky.ts +1 -0
|
@@ -23,6 +23,7 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
23
23
|
private _shadowType;
|
|
24
24
|
private _type;
|
|
25
25
|
private _vsmBias;
|
|
26
|
+
private _vsmBlurSize;
|
|
26
27
|
/** @ignore */
|
|
27
28
|
constructor();
|
|
28
29
|
getInitialComponentData(): {
|
|
@@ -40,6 +41,7 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
40
41
|
shadowType: number | undefined;
|
|
41
42
|
type: string;
|
|
42
43
|
vsmBias: number;
|
|
44
|
+
vsmBlurSize: number;
|
|
43
45
|
};
|
|
44
46
|
/**
|
|
45
47
|
* Gets the underlying PlayCanvas light component.
|
|
@@ -196,6 +198,16 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
196
198
|
* @returns The VSM bias.
|
|
197
199
|
*/
|
|
198
200
|
get vsmBias(): number;
|
|
201
|
+
/**
|
|
202
|
+
* Sets the VSM blur size of the light. Minimum is 1, maximum is 25. Default is 11.
|
|
203
|
+
* @param value - The VSM blur size.
|
|
204
|
+
*/
|
|
205
|
+
set vsmBlurSize(value: number);
|
|
206
|
+
/**
|
|
207
|
+
* Gets the VSM blur size of the light.
|
|
208
|
+
* @returns The VSM blur size.
|
|
209
|
+
*/
|
|
210
|
+
get vsmBlurSize(): number;
|
|
199
211
|
static get observedAttributes(): string[];
|
|
200
212
|
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
|
|
201
213
|
}
|
package/dist/pwc.cjs
CHANGED
|
@@ -2352,6 +2352,7 @@ class LightComponentElement extends ComponentElement {
|
|
|
2352
2352
|
this._shadowType = 'pcf3-32f';
|
|
2353
2353
|
this._type = 'directional';
|
|
2354
2354
|
this._vsmBias = 0.01;
|
|
2355
|
+
this._vsmBlurSize = 11;
|
|
2355
2356
|
}
|
|
2356
2357
|
getInitialComponentData() {
|
|
2357
2358
|
return {
|
|
@@ -2368,7 +2369,8 @@ class LightComponentElement extends ComponentElement {
|
|
|
2368
2369
|
shadowResolution: this._shadowResolution,
|
|
2369
2370
|
shadowType: shadowTypes.get(this._shadowType),
|
|
2370
2371
|
type: this._type,
|
|
2371
|
-
vsmBias: this._vsmBias
|
|
2372
|
+
vsmBias: this._vsmBias,
|
|
2373
|
+
vsmBlurSize: this._vsmBlurSize
|
|
2372
2374
|
};
|
|
2373
2375
|
}
|
|
2374
2376
|
/**
|
|
@@ -2631,6 +2633,23 @@ class LightComponentElement extends ComponentElement {
|
|
|
2631
2633
|
get vsmBias() {
|
|
2632
2634
|
return this._vsmBias;
|
|
2633
2635
|
}
|
|
2636
|
+
/**
|
|
2637
|
+
* Sets the VSM blur size of the light. Minimum is 1, maximum is 25. Default is 11.
|
|
2638
|
+
* @param value - The VSM blur size.
|
|
2639
|
+
*/
|
|
2640
|
+
set vsmBlurSize(value) {
|
|
2641
|
+
this._vsmBlurSize = value;
|
|
2642
|
+
if (this.component) {
|
|
2643
|
+
this.component.vsmBlurSize = value;
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
/**
|
|
2647
|
+
* Gets the VSM blur size of the light.
|
|
2648
|
+
* @returns The VSM blur size.
|
|
2649
|
+
*/
|
|
2650
|
+
get vsmBlurSize() {
|
|
2651
|
+
return this._vsmBlurSize;
|
|
2652
|
+
}
|
|
2634
2653
|
static get observedAttributes() {
|
|
2635
2654
|
return [
|
|
2636
2655
|
...super.observedAttributes,
|
|
@@ -2647,7 +2666,8 @@ class LightComponentElement extends ComponentElement {
|
|
|
2647
2666
|
'shadow-resolution',
|
|
2648
2667
|
'shadow-type',
|
|
2649
2668
|
'type',
|
|
2650
|
-
'vsm-bias'
|
|
2669
|
+
'vsm-bias',
|
|
2670
|
+
'vsm-blur-size'
|
|
2651
2671
|
];
|
|
2652
2672
|
}
|
|
2653
2673
|
attributeChangedCallback(name, _oldValue, newValue) {
|
|
@@ -2695,6 +2715,9 @@ class LightComponentElement extends ComponentElement {
|
|
|
2695
2715
|
case 'vsm-bias':
|
|
2696
2716
|
this.vsmBias = Number(newValue);
|
|
2697
2717
|
break;
|
|
2718
|
+
case 'vsm-blur-size':
|
|
2719
|
+
this.vsmBlurSize = Number(newValue);
|
|
2720
|
+
break;
|
|
2698
2721
|
}
|
|
2699
2722
|
}
|
|
2700
2723
|
}
|
|
@@ -3931,7 +3954,6 @@ class SoundSlotElement extends AsyncElement {
|
|
|
3931
3954
|
}
|
|
3932
3955
|
this.soundSlot = this.soundElement.component.addSlot(this._name, options);
|
|
3933
3956
|
this.asset = this._asset;
|
|
3934
|
-
this.soundSlot.play();
|
|
3935
3957
|
this._onReady();
|
|
3936
3958
|
}
|
|
3937
3959
|
disconnectedCallback() {
|
|
@@ -4103,13 +4125,16 @@ class SoundSlotElement extends AsyncElement {
|
|
|
4103
4125
|
return this._volume;
|
|
4104
4126
|
}
|
|
4105
4127
|
static get observedAttributes() {
|
|
4106
|
-
return ['asset', '
|
|
4128
|
+
return ['asset', 'auto-play', 'duration', 'loop', 'name', 'overlap', 'pitch', 'start-time', 'volume'];
|
|
4107
4129
|
}
|
|
4108
4130
|
attributeChangedCallback(name, _oldValue, newValue) {
|
|
4109
4131
|
switch (name) {
|
|
4110
4132
|
case 'asset':
|
|
4111
4133
|
this.asset = newValue;
|
|
4112
4134
|
break;
|
|
4135
|
+
case 'auto-play':
|
|
4136
|
+
this.autoPlay = this.hasAttribute('auto-play');
|
|
4137
|
+
break;
|
|
4113
4138
|
case 'duration':
|
|
4114
4139
|
this.duration = parseFloat(newValue);
|
|
4115
4140
|
break;
|
|
@@ -4125,7 +4150,7 @@ class SoundSlotElement extends AsyncElement {
|
|
|
4125
4150
|
case 'pitch':
|
|
4126
4151
|
this.pitch = parseFloat(newValue);
|
|
4127
4152
|
break;
|
|
4128
|
-
case '
|
|
4153
|
+
case 'start-time':
|
|
4129
4154
|
this.startTime = parseFloat(newValue);
|
|
4130
4155
|
break;
|
|
4131
4156
|
case 'volume':
|
|
@@ -4523,6 +4548,7 @@ class SkyElement extends AsyncElement {
|
|
|
4523
4548
|
this._scene.sky.node.setLocalScale(this._scale);
|
|
4524
4549
|
this._scene.sky.center = this._center;
|
|
4525
4550
|
this._scene.skyboxIntensity = this._intensity;
|
|
4551
|
+
this._scene.skyboxMip = this._level;
|
|
4526
4552
|
}
|
|
4527
4553
|
async _loadSkybox() {
|
|
4528
4554
|
var _a;
|