@playcanvas/web-components 0.7.0 → 0.8.0

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.mjs CHANGED
@@ -6218,13 +6218,17 @@ class GSplatComponentElement extends ComponentElement {
6218
6218
  this._castShadows = false;
6219
6219
  this._lodBaseDistance = 5;
6220
6220
  this._lodMultiplier = 3;
6221
+ this._lodRangeMin = 0;
6222
+ this._lodRangeMax = 99;
6221
6223
  }
6222
6224
  getInitialComponentData() {
6223
6225
  return {
6224
6226
  asset: AssetElement.get(this._asset),
6225
6227
  castShadows: this._castShadows,
6226
6228
  lodBaseDistance: this._lodBaseDistance,
6227
- lodMultiplier: this._lodMultiplier
6229
+ lodMultiplier: this._lodMultiplier,
6230
+ lodRangeMin: this._lodRangeMin,
6231
+ lodRangeMax: this._lodRangeMax
6228
6232
  };
6229
6233
  }
6230
6234
  /**
@@ -6310,13 +6314,54 @@ class GSplatComponentElement extends ComponentElement {
6310
6314
  get lodMultiplier() {
6311
6315
  return this._lodMultiplier;
6312
6316
  }
6317
+ /**
6318
+ * Sets the minimum allowed LOD index (inclusive). The LOD selected by distance is clamped so it
6319
+ * never goes finer (lower index) than this value. Raising it avoids downloading the highest
6320
+ * quality (largest) LOD files. Defaults to 0. Only affects assets that contain LOD levels (e.g.
6321
+ * `.lod-meta.json`).
6322
+ * @param value - The minimum LOD index.
6323
+ */
6324
+ set lodRangeMin(value) {
6325
+ this._lodRangeMin = value;
6326
+ if (this.component) {
6327
+ this.component.lodRangeMin = value;
6328
+ }
6329
+ }
6330
+ /**
6331
+ * Gets the minimum allowed LOD index.
6332
+ * @returns The minimum LOD index.
6333
+ */
6334
+ get lodRangeMin() {
6335
+ return this._lodRangeMin;
6336
+ }
6337
+ /**
6338
+ * Sets the maximum allowed LOD index (inclusive). The LOD selected by distance is clamped so it
6339
+ * never goes coarser (higher index) than this value. The default of 99 effectively means "no
6340
+ * cap". Defaults to 99. Only affects assets that contain LOD levels (e.g. `.lod-meta.json`).
6341
+ * @param value - The maximum LOD index.
6342
+ */
6343
+ set lodRangeMax(value) {
6344
+ this._lodRangeMax = value;
6345
+ if (this.component) {
6346
+ this.component.lodRangeMax = value;
6347
+ }
6348
+ }
6349
+ /**
6350
+ * Gets the maximum allowed LOD index.
6351
+ * @returns The maximum LOD index.
6352
+ */
6353
+ get lodRangeMax() {
6354
+ return this._lodRangeMax;
6355
+ }
6313
6356
  static get observedAttributes() {
6314
6357
  return [
6315
6358
  ...super.observedAttributes,
6316
6359
  'asset',
6317
6360
  'cast-shadows',
6318
6361
  'lod-base-distance',
6319
- 'lod-multiplier'
6362
+ 'lod-multiplier',
6363
+ 'lod-range-min',
6364
+ 'lod-range-max'
6320
6365
  ];
6321
6366
  }
6322
6367
  attributeChangedCallback(name, _oldValue, newValue) {
@@ -6334,6 +6379,12 @@ class GSplatComponentElement extends ComponentElement {
6334
6379
  case 'lod-multiplier':
6335
6380
  this.lodMultiplier = Number(newValue);
6336
6381
  break;
6382
+ case 'lod-range-min':
6383
+ this.lodRangeMin = Number(newValue);
6384
+ break;
6385
+ case 'lod-range-max':
6386
+ this.lodRangeMax = Number(newValue);
6387
+ break;
6337
6388
  }
6338
6389
  }
6339
6390
  }