@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.
@@ -13,6 +13,8 @@ declare class GSplatComponentElement extends ComponentElement {
13
13
  private _castShadows;
14
14
  private _lodBaseDistance;
15
15
  private _lodMultiplier;
16
+ private _lodRangeMin;
17
+ private _lodRangeMax;
16
18
  /** @ignore */
17
19
  constructor();
18
20
  getInitialComponentData(): {
@@ -20,6 +22,8 @@ declare class GSplatComponentElement extends ComponentElement {
20
22
  castShadows: boolean;
21
23
  lodBaseDistance: number;
22
24
  lodMultiplier: number;
25
+ lodRangeMin: number;
26
+ lodRangeMax: number;
23
27
  };
24
28
  /**
25
29
  * Gets the underlying PlayCanvas gsplat component.
@@ -73,6 +77,31 @@ declare class GSplatComponentElement extends ComponentElement {
73
77
  * @returns The LOD multiplier.
74
78
  */
75
79
  get lodMultiplier(): number;
80
+ /**
81
+ * Sets the minimum allowed LOD index (inclusive). The LOD selected by distance is clamped so it
82
+ * never goes finer (lower index) than this value. Raising it avoids downloading the highest
83
+ * quality (largest) LOD files. Defaults to 0. Only affects assets that contain LOD levels (e.g.
84
+ * `.lod-meta.json`).
85
+ * @param value - The minimum LOD index.
86
+ */
87
+ set lodRangeMin(value: number);
88
+ /**
89
+ * Gets the minimum allowed LOD index.
90
+ * @returns The minimum LOD index.
91
+ */
92
+ get lodRangeMin(): number;
93
+ /**
94
+ * Sets the maximum allowed LOD index (inclusive). The LOD selected by distance is clamped so it
95
+ * never goes coarser (higher index) than this value. The default of 99 effectively means "no
96
+ * cap". Defaults to 99. Only affects assets that contain LOD levels (e.g. `.lod-meta.json`).
97
+ * @param value - The maximum LOD index.
98
+ */
99
+ set lodRangeMax(value: number);
100
+ /**
101
+ * Gets the maximum allowed LOD index.
102
+ * @returns The maximum LOD index.
103
+ */
104
+ get lodRangeMax(): number;
76
105
  static get observedAttributes(): string[];
77
106
  attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
78
107
  }
package/dist/pwc.cjs CHANGED
@@ -6220,13 +6220,17 @@ class GSplatComponentElement extends ComponentElement {
6220
6220
  this._castShadows = false;
6221
6221
  this._lodBaseDistance = 5;
6222
6222
  this._lodMultiplier = 3;
6223
+ this._lodRangeMin = 0;
6224
+ this._lodRangeMax = 99;
6223
6225
  }
6224
6226
  getInitialComponentData() {
6225
6227
  return {
6226
6228
  asset: AssetElement.get(this._asset),
6227
6229
  castShadows: this._castShadows,
6228
6230
  lodBaseDistance: this._lodBaseDistance,
6229
- lodMultiplier: this._lodMultiplier
6231
+ lodMultiplier: this._lodMultiplier,
6232
+ lodRangeMin: this._lodRangeMin,
6233
+ lodRangeMax: this._lodRangeMax
6230
6234
  };
6231
6235
  }
6232
6236
  /**
@@ -6312,13 +6316,54 @@ class GSplatComponentElement extends ComponentElement {
6312
6316
  get lodMultiplier() {
6313
6317
  return this._lodMultiplier;
6314
6318
  }
6319
+ /**
6320
+ * Sets the minimum allowed LOD index (inclusive). The LOD selected by distance is clamped so it
6321
+ * never goes finer (lower index) than this value. Raising it avoids downloading the highest
6322
+ * quality (largest) LOD files. Defaults to 0. Only affects assets that contain LOD levels (e.g.
6323
+ * `.lod-meta.json`).
6324
+ * @param value - The minimum LOD index.
6325
+ */
6326
+ set lodRangeMin(value) {
6327
+ this._lodRangeMin = value;
6328
+ if (this.component) {
6329
+ this.component.lodRangeMin = value;
6330
+ }
6331
+ }
6332
+ /**
6333
+ * Gets the minimum allowed LOD index.
6334
+ * @returns The minimum LOD index.
6335
+ */
6336
+ get lodRangeMin() {
6337
+ return this._lodRangeMin;
6338
+ }
6339
+ /**
6340
+ * Sets the maximum allowed LOD index (inclusive). The LOD selected by distance is clamped so it
6341
+ * never goes coarser (higher index) than this value. The default of 99 effectively means "no
6342
+ * cap". Defaults to 99. Only affects assets that contain LOD levels (e.g. `.lod-meta.json`).
6343
+ * @param value - The maximum LOD index.
6344
+ */
6345
+ set lodRangeMax(value) {
6346
+ this._lodRangeMax = value;
6347
+ if (this.component) {
6348
+ this.component.lodRangeMax = value;
6349
+ }
6350
+ }
6351
+ /**
6352
+ * Gets the maximum allowed LOD index.
6353
+ * @returns The maximum LOD index.
6354
+ */
6355
+ get lodRangeMax() {
6356
+ return this._lodRangeMax;
6357
+ }
6315
6358
  static get observedAttributes() {
6316
6359
  return [
6317
6360
  ...super.observedAttributes,
6318
6361
  'asset',
6319
6362
  'cast-shadows',
6320
6363
  'lod-base-distance',
6321
- 'lod-multiplier'
6364
+ 'lod-multiplier',
6365
+ 'lod-range-min',
6366
+ 'lod-range-max'
6322
6367
  ];
6323
6368
  }
6324
6369
  attributeChangedCallback(name, _oldValue, newValue) {
@@ -6336,6 +6381,12 @@ class GSplatComponentElement extends ComponentElement {
6336
6381
  case 'lod-multiplier':
6337
6382
  this.lodMultiplier = Number(newValue);
6338
6383
  break;
6384
+ case 'lod-range-min':
6385
+ this.lodRangeMin = Number(newValue);
6386
+ break;
6387
+ case 'lod-range-max':
6388
+ this.lodRangeMax = Number(newValue);
6389
+ break;
6339
6390
  }
6340
6391
  }
6341
6392
  }