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