@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/pwc.js CHANGED
@@ -2354,6 +2354,7 @@
2354
2354
  this._shadowType = 'pcf3-32f';
2355
2355
  this._type = 'directional';
2356
2356
  this._vsmBias = 0.01;
2357
+ this._vsmBlurSize = 11;
2357
2358
  }
2358
2359
  getInitialComponentData() {
2359
2360
  return {
@@ -2370,7 +2371,8 @@
2370
2371
  shadowResolution: this._shadowResolution,
2371
2372
  shadowType: shadowTypes.get(this._shadowType),
2372
2373
  type: this._type,
2373
- vsmBias: this._vsmBias
2374
+ vsmBias: this._vsmBias,
2375
+ vsmBlurSize: this._vsmBlurSize
2374
2376
  };
2375
2377
  }
2376
2378
  /**
@@ -2633,6 +2635,23 @@
2633
2635
  get vsmBias() {
2634
2636
  return this._vsmBias;
2635
2637
  }
2638
+ /**
2639
+ * Sets the VSM blur size of the light. Minimum is 1, maximum is 25. Default is 11.
2640
+ * @param value - The VSM blur size.
2641
+ */
2642
+ set vsmBlurSize(value) {
2643
+ this._vsmBlurSize = value;
2644
+ if (this.component) {
2645
+ this.component.vsmBlurSize = value;
2646
+ }
2647
+ }
2648
+ /**
2649
+ * Gets the VSM blur size of the light.
2650
+ * @returns The VSM blur size.
2651
+ */
2652
+ get vsmBlurSize() {
2653
+ return this._vsmBlurSize;
2654
+ }
2636
2655
  static get observedAttributes() {
2637
2656
  return [
2638
2657
  ...super.observedAttributes,
@@ -2649,7 +2668,8 @@
2649
2668
  'shadow-resolution',
2650
2669
  'shadow-type',
2651
2670
  'type',
2652
- 'vsm-bias'
2671
+ 'vsm-bias',
2672
+ 'vsm-blur-size'
2653
2673
  ];
2654
2674
  }
2655
2675
  attributeChangedCallback(name, _oldValue, newValue) {
@@ -2697,6 +2717,9 @@
2697
2717
  case 'vsm-bias':
2698
2718
  this.vsmBias = Number(newValue);
2699
2719
  break;
2720
+ case 'vsm-blur-size':
2721
+ this.vsmBlurSize = Number(newValue);
2722
+ break;
2700
2723
  }
2701
2724
  }
2702
2725
  }
@@ -3933,7 +3956,6 @@
3933
3956
  }
3934
3957
  this.soundSlot = this.soundElement.component.addSlot(this._name, options);
3935
3958
  this.asset = this._asset;
3936
- this.soundSlot.play();
3937
3959
  this._onReady();
3938
3960
  }
3939
3961
  disconnectedCallback() {
@@ -4105,13 +4127,16 @@
4105
4127
  return this._volume;
4106
4128
  }
4107
4129
  static get observedAttributes() {
4108
- return ['asset', 'autoPlay', 'duration', 'loop', 'name', 'overlap', 'pitch', 'startTime', 'volume'];
4130
+ return ['asset', 'auto-play', 'duration', 'loop', 'name', 'overlap', 'pitch', 'start-time', 'volume'];
4109
4131
  }
4110
4132
  attributeChangedCallback(name, _oldValue, newValue) {
4111
4133
  switch (name) {
4112
4134
  case 'asset':
4113
4135
  this.asset = newValue;
4114
4136
  break;
4137
+ case 'auto-play':
4138
+ this.autoPlay = this.hasAttribute('auto-play');
4139
+ break;
4115
4140
  case 'duration':
4116
4141
  this.duration = parseFloat(newValue);
4117
4142
  break;
@@ -4127,7 +4152,7 @@
4127
4152
  case 'pitch':
4128
4153
  this.pitch = parseFloat(newValue);
4129
4154
  break;
4130
- case 'startTime':
4155
+ case 'start-time':
4131
4156
  this.startTime = parseFloat(newValue);
4132
4157
  break;
4133
4158
  case 'volume':
@@ -4525,6 +4550,7 @@
4525
4550
  this._scene.sky.node.setLocalScale(this._scale);
4526
4551
  this._scene.sky.center = this._center;
4527
4552
  this._scene.skyboxIntensity = this._intensity;
4553
+ this._scene.skyboxMip = this._level;
4528
4554
  }
4529
4555
  async _loadSkybox() {
4530
4556
  var _a;