@heliguy-xyz/splat-viewer 1.0.0-rc.7 → 1.0.0-rc.9
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/web-component/ModelManager.d.ts +12 -0
- package/dist/web-component/ModelManager.d.ts.map +1 -1
- package/dist/web-component/SplatViewerCore.d.ts +47 -0
- package/dist/web-component/SplatViewerCore.d.ts.map +1 -1
- package/dist/web-component/SplatViewerElement.d.ts +40 -0
- package/dist/web-component/SplatViewerElement.d.ts.map +1 -1
- package/dist/web-component/splat-viewer.esm.js +337 -1
- package/dist/web-component/splat-viewer.esm.min.js +2 -2
- package/dist/web-component/splat-viewer.js +337 -1
- package/dist/web-component/splat-viewer.min.js +2 -2
- package/dist/web-component/types/ModelManager.d.ts +12 -0
- package/dist/web-component/types/ModelManager.d.ts.map +1 -1
- package/dist/web-component/types/SplatViewerCore.d.ts +47 -0
- package/dist/web-component/types/SplatViewerCore.d.ts.map +1 -1
- package/dist/web-component/types/SplatViewerElement.d.ts +40 -0
- package/dist/web-component/types/SplatViewerElement.d.ts.map +1 -1
- package/dist/web-component/types/core.d.ts +9 -1
- package/dist/web-component/types/core.d.ts.map +1 -1
- package/dist/web-component/types/enhanced-viewer.d.ts +41 -1
- package/dist/web-component/types/enhanced-viewer.d.ts.map +1 -1
- package/dist/web-component/types/events.d.ts +20 -1
- package/dist/web-component/types/events.d.ts.map +1 -1
- package/dist/web-component/types/types/core.d.ts +9 -1
- package/dist/web-component/types/types/core.d.ts.map +1 -1
- package/dist/web-component/types/types/enhanced-viewer.d.ts +41 -1
- package/dist/web-component/types/types/enhanced-viewer.d.ts.map +1 -1
- package/dist/web-component/types/types/events.d.ts +20 -1
- package/dist/web-component/types/types/events.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -91,6 +91,18 @@ export declare class ModelManager {
|
|
|
91
91
|
* @param transform New transform data
|
|
92
92
|
*/
|
|
93
93
|
updateModelTransform(modelId: string, transform: TransformData): void;
|
|
94
|
+
/**
|
|
95
|
+
* Set visibility for a specific model by ID
|
|
96
|
+
* @param modelId ID of the model
|
|
97
|
+
* @param visible True to show, false to hide
|
|
98
|
+
*/
|
|
99
|
+
setModelVisible(modelId: string, visible: boolean): void;
|
|
100
|
+
/**
|
|
101
|
+
* Set visibility for all models matching a given name
|
|
102
|
+
* @param name Model name to match (case-sensitive)
|
|
103
|
+
* @param visible True to show, false to hide
|
|
104
|
+
*/
|
|
105
|
+
setModelsVisibleByName(name: string, visible: boolean): void;
|
|
94
106
|
}
|
|
95
107
|
export default ModelManager;
|
|
96
108
|
//# sourceMappingURL=ModelManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelManager.d.ts","sourceRoot":"","sources":["../../src/web-component/ModelManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EACV,eAAe,EAGf,SAAS,EACT,aAAa,EACb,qBAAqB,EAGrB,aAAa,EACb,aAAa,EAEd,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"ModelManager.d.ts","sourceRoot":"","sources":["../../src/web-component/ModelManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EACV,eAAe,EAGf,SAAS,EACT,aAAa,EACb,qBAAqB,EAGrB,aAAa,EACb,aAAa,EAEd,MAAM,SAAS,CAAA;AAWhB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,GAAG,CAAuB;IAClC,OAAO,CAAC,aAAa,CAAwD;gBAG3E,GAAG,EAAE,qBAAqB,EAC1B,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,IAAI;IAMzD;;OAEG;IACH,OAAO,CAAC,eAAe;IASvB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;OAEG;IACH,OAAO,CAAC,eAAe;IA2DvB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA2BzB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAmD5B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAkC1B;;;;;OAKG;IACU,QAAQ,CACnB,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,EAC5B,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,SAAS,CAAC;IAkKrB;;;OAGG;IACI,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAgCzC;;;OAGG;IACI,SAAS,IAAI,SAAS,EAAE;IAW/B;;;;OAIG;IACI,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAgB3D;;;;OAIG;IACI,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa;IAUpD;;;OAGG;IACI,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAUxD;;;OAGG;IACI,aAAa,IAAI,aAAa;IA4DrC;;OAEG;IACI,KAAK,IAAI,IAAI;IAapB;;;;OAIG;IACI,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,IAAI;IAY5E;;;;OAIG;IACI,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAwB/D;;;;OAIG;IACI,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAqBpE;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -30,6 +30,8 @@ export declare class SplatViewerCore implements SplatViewerCoreInterface {
|
|
|
30
30
|
private _transformSystem;
|
|
31
31
|
private _sceneConfigManager;
|
|
32
32
|
private _eventListeners;
|
|
33
|
+
private _splatCenterSize;
|
|
34
|
+
private _sphericalHarmonicsBands;
|
|
33
35
|
constructor(options?: SplatViewerCoreOptions);
|
|
34
36
|
init(canvas: HTMLCanvasElement): SplatViewerCore;
|
|
35
37
|
load(source: string | File | Blob, options?: LoadOptions): Promise<LoadResult>;
|
|
@@ -75,6 +77,51 @@ export declare class SplatViewerCore implements SplatViewerCoreInterface {
|
|
|
75
77
|
* @returns Scene-wide metadata
|
|
76
78
|
*/
|
|
77
79
|
getSceneStats(): SceneMetadata;
|
|
80
|
+
/**
|
|
81
|
+
* Set fly camera base movement speed (convenience over setFlyCameraConfig)
|
|
82
|
+
* @param speed Units per second (must be > 0)
|
|
83
|
+
*/
|
|
84
|
+
setFlyCameraSpeed(speed: number): void;
|
|
85
|
+
/**
|
|
86
|
+
* Get current fly camera base movement speed
|
|
87
|
+
* @returns Speed in units per second, or null if fly camera not initialized
|
|
88
|
+
*/
|
|
89
|
+
getFlyCameraSpeed(): number | null;
|
|
90
|
+
/**
|
|
91
|
+
* Set visibility for a specific model by ID
|
|
92
|
+
* @param modelId ID of the model
|
|
93
|
+
* @param visible True to show, false to hide
|
|
94
|
+
*/
|
|
95
|
+
setModelVisible(modelId: string, visible: boolean): void;
|
|
96
|
+
/**
|
|
97
|
+
* Set visibility for all models matching a given name
|
|
98
|
+
* @param name Model name to match (case-sensitive)
|
|
99
|
+
* @param visible True to show, false to hide
|
|
100
|
+
*/
|
|
101
|
+
setModelsVisibleByName(name: string, visible: boolean): void;
|
|
102
|
+
/**
|
|
103
|
+
* Set rendered centers size for all splat models.
|
|
104
|
+
* This maps onto underlying gsplat / renderer properties when available.
|
|
105
|
+
* @param size Positive size value (implementation-specific units)
|
|
106
|
+
*/
|
|
107
|
+
setSplatCenterSize(size: number): void;
|
|
108
|
+
/**
|
|
109
|
+
* Get current centers size value last set via API.
|
|
110
|
+
* Returns null if not configured yet.
|
|
111
|
+
*/
|
|
112
|
+
getSplatCenterSize(): number | null;
|
|
113
|
+
/**
|
|
114
|
+
* Set spherical harmonics bands for all splat models.
|
|
115
|
+
* @param bands Integer band count (0-3)
|
|
116
|
+
*/
|
|
117
|
+
setSphericalHarmonicsBands(bands: number): void;
|
|
118
|
+
/**
|
|
119
|
+
* Get current spherical harmonics bands setting last configured via API.
|
|
120
|
+
* Returns null if not configured yet.
|
|
121
|
+
*/
|
|
122
|
+
getSphericalHarmonicsBands(): number | null;
|
|
123
|
+
private _applySplatRenderingConfigToEntity;
|
|
124
|
+
private _forEachSplatEntity;
|
|
78
125
|
/**
|
|
79
126
|
* Apply a 4x4 transformation matrix to a model
|
|
80
127
|
* @param modelId ID of the model
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplatViewerCore.d.ts","sourceRoot":"","sources":["../../src/web-component/SplatViewerCore.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,SAAS,EACT,eAAe,EACf,cAAc,EACd,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EAEb,qBAAqB,EAErB,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EAEjB,aAAa,EACb,OAAO,EACR,MAAM,SAAS,CAAA;AAGhB,qBAAa,eAAgB,YAAW,wBAAwB;IACvD,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAO;IACvC,GAAG,EAAE,qBAAqB,GAAG,IAAI,CAAO;IACxC,QAAQ,EAAE;QACf,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAA;QAC/B,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAA;QAC9B,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAA;KAC/B,CAIA;IACM,WAAW,EAAE,OAAO,CAAQ;IAC5B,SAAS,EAAE,OAAO,CAAO;IACzB,SAAS,EAAE,OAAO,CAAQ;IAC1B,QAAQ,EAAE,OAAO,CAAQ;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAO;IAElC,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,kBAAkB,CAAiC;IAC3D,OAAO,CAA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GAAG,IAAI;IAI5C,iBAAiB,IAAI,cAAc,GAAG,IAAI;IAIjD,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,iBAAiB;IA6FzB,OAAO,CAAC,WAAW;IAkDnB,OAAO,CAAC,gBAAgB;IA8HxB;;;OAGG;IACI,sBAAsB,IAAI,IAAI;CAoBtC;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -182,6 +182,18 @@ export declare class SplatViewerElement extends HTMLElement {
|
|
|
182
182
|
* @returns Scene-wide metadata
|
|
183
183
|
*/
|
|
184
184
|
getSceneStats(): SceneMetadata;
|
|
185
|
+
/**
|
|
186
|
+
* Set visibility for a specific model by ID
|
|
187
|
+
* @param modelId ID of the model
|
|
188
|
+
* @param visible True to show, false to hide
|
|
189
|
+
*/
|
|
190
|
+
setModelVisible(modelId: string, visible: boolean): void;
|
|
191
|
+
/**
|
|
192
|
+
* Set visibility for all models matching a given name
|
|
193
|
+
* @param name Model name to match (case-sensitive)
|
|
194
|
+
* @param visible True to show, false to hide
|
|
195
|
+
*/
|
|
196
|
+
setModelsVisibleByName(name: string, visible: boolean): void;
|
|
185
197
|
setCameraMode(mode: CameraMode): void;
|
|
186
198
|
getCameraMode(): CameraMode;
|
|
187
199
|
setFlyCameraConfig(config: Partial<FlyCameraConfig>): void;
|
|
@@ -190,9 +202,37 @@ export declare class SplatViewerElement extends HTMLElement {
|
|
|
190
202
|
setCameraFOV(fov: number): void;
|
|
191
203
|
getCameraFOV(): number;
|
|
192
204
|
animateCameraFOV(targetFOV: number, duration: number): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* Set fly camera base movement speed (convenience over setFlyCameraConfig)
|
|
207
|
+
* @param speed Units per second (must be > 0)
|
|
208
|
+
*/
|
|
209
|
+
setFlyCameraSpeed(speed: number): void;
|
|
210
|
+
/**
|
|
211
|
+
* Get current fly camera base movement speed
|
|
212
|
+
* @returns Speed in units per second, or null if fly camera not initialized
|
|
213
|
+
*/
|
|
214
|
+
getFlyCameraSpeed(): number | null;
|
|
193
215
|
setBackgroundColor(color: ColorInput): void;
|
|
194
216
|
getBackgroundColor(): ColorRGBA;
|
|
195
217
|
animateBackgroundColor(targetColor: ColorInput, duration: number): Promise<void>;
|
|
218
|
+
/**
|
|
219
|
+
* Set rendered centers size for all splat models
|
|
220
|
+
* @param size Positive size value (implementation-specific units)
|
|
221
|
+
*/
|
|
222
|
+
setSplatCenterSize(size: number): void;
|
|
223
|
+
/**
|
|
224
|
+
* Get current centers size value last set via API
|
|
225
|
+
*/
|
|
226
|
+
getSplatCenterSize(): number | null;
|
|
227
|
+
/**
|
|
228
|
+
* Set spherical harmonics bands for all splat models
|
|
229
|
+
* @param bands Integer band count (0-3)
|
|
230
|
+
*/
|
|
231
|
+
setSphericalHarmonicsBands(bands: number): void;
|
|
232
|
+
/**
|
|
233
|
+
* Get current spherical harmonics bands setting last configured via API
|
|
234
|
+
*/
|
|
235
|
+
getSphericalHarmonicsBands(): number | null;
|
|
196
236
|
/**
|
|
197
237
|
* Apply a 4x4 transformation matrix to a model
|
|
198
238
|
* @param modelId ID of the model
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplatViewerElement.d.ts","sourceRoot":"","sources":["../../src/web-component/SplatViewerElement.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EAEf,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,eAAe,EACf,cAAc,EAMd,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,OAAO,EACR,MAAM,SAAS,CAAA;AAQhB;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IAEjD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAoBxC;IAGD,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,OAAO,CAAiC;IACh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kB;IAQ1B;;OAEG;IACH,OAAO,CAAC,oBAAoB;
|
|
1
|
+
{"version":3,"file":"SplatViewerElement.d.ts","sourceRoot":"","sources":["../../src/web-component/SplatViewerElement.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EAEf,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,eAAe,EACf,cAAc,EAMd,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,OAAO,EACR,MAAM,SAAS,CAAA;AAQhB;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IAEjD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAoBxC;IAGD,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,OAAO,CAA2C;IAC1D,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,mBAAmB,CAA8B;IAKzD,IAAI,GAAG,IAAI,MAAM,GAAG,IAAI,CAEvB;IAED,IAAI,KAAK,IAAI,MAAM,GAAG,IAAI,CAEzB;IAED,IAAI,MAAM,IAAI,MAAM,GAAG,IAAI,CAE1B;IAED,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAE7B;IAED,IAAI,cAAc,IAAI,MAAM,GAAG,IAAI,CAElC;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,IAAI,CAEhC;IAED,IAAI,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAEpC;IAED,IAAI,cAAc,IAAI,MAAM,GAAG,IAAI,CAElC;IAED,IAAI,eAAe,IAAI,MAAM,GAAG,IAAI,CAEnC;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,IAAI,CAE/B;IAED,IAAI,W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IAAI;IASlC,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAS3C,kBAAkB,IAAI,SAAS;IASzB,sBAAsB,CAC1B,WAAW,EAAE,UAAU,EACvB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAShB;;;OAGG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAStC;;OAEG;IACH,kBAAkB,IAAI,MAAM,GAAG,IAAI;IASnC;;;OAGG;IACH,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAS/C;;OAEG;IACH,0BAA0B,IAAI,MAAM,GAAG,IAAI;IAa3C;;;;OAIG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI;IAU9D;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;IAU1D;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;IAU1D;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAUpD;;;;OAIG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa;IAUjD;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAS3C;AAOD,eAAe,kBAAkB,CAAA"}
|
|
@@ -105350,6 +105350,7 @@ class ModelManager {
|
|
|
105350
105350
|
transform,
|
|
105351
105351
|
metadata,
|
|
105352
105352
|
loadStartTime,
|
|
105353
|
+
visible: true,
|
|
105353
105354
|
};
|
|
105354
105355
|
if (blobUrl !== undefined) {
|
|
105355
105356
|
modelInfo.blobUrl = blobUrl;
|
|
@@ -105553,6 +105554,54 @@ class ModelManager {
|
|
|
105553
105554
|
model.transform = transform;
|
|
105554
105555
|
model.metadata.transform = transform;
|
|
105555
105556
|
}
|
|
105557
|
+
/**
|
|
105558
|
+
* Set visibility for a specific model by ID
|
|
105559
|
+
* @param modelId ID of the model
|
|
105560
|
+
* @param visible True to show, false to hide
|
|
105561
|
+
*/
|
|
105562
|
+
setModelVisible(modelId, visible) {
|
|
105563
|
+
const model = this.models.get(modelId);
|
|
105564
|
+
if (!model) {
|
|
105565
|
+
throw new Error(`Model with ID "${modelId}" not found`);
|
|
105566
|
+
}
|
|
105567
|
+
// Apply visibility to underlying entity
|
|
105568
|
+
if (model.entity) {
|
|
105569
|
+
model.entity.enabled = visible;
|
|
105570
|
+
}
|
|
105571
|
+
model.visible = visible;
|
|
105572
|
+
// Emit model-visibility-changed event
|
|
105573
|
+
if (this._eventEmitter) {
|
|
105574
|
+
this._eventEmitter('model-visibility-changed', {
|
|
105575
|
+
modelId: model.id,
|
|
105576
|
+
name: model.name,
|
|
105577
|
+
visible,
|
|
105578
|
+
});
|
|
105579
|
+
}
|
|
105580
|
+
}
|
|
105581
|
+
/**
|
|
105582
|
+
* Set visibility for all models matching a given name
|
|
105583
|
+
* @param name Model name to match (case-sensitive)
|
|
105584
|
+
* @param visible True to show, false to hide
|
|
105585
|
+
*/
|
|
105586
|
+
setModelsVisibleByName(name, visible) {
|
|
105587
|
+
for (const model of this.models.values()) {
|
|
105588
|
+
if (model.name === name) {
|
|
105589
|
+
// Apply visibility to entity
|
|
105590
|
+
if (model.entity) {
|
|
105591
|
+
model.entity.enabled = visible;
|
|
105592
|
+
}
|
|
105593
|
+
model.visible = visible;
|
|
105594
|
+
// Emit model-visibility-changed event for each affected model
|
|
105595
|
+
if (this._eventEmitter) {
|
|
105596
|
+
this._eventEmitter('model-visibility-changed', {
|
|
105597
|
+
modelId: model.id,
|
|
105598
|
+
name: model.name,
|
|
105599
|
+
visible,
|
|
105600
|
+
});
|
|
105601
|
+
}
|
|
105602
|
+
}
|
|
105603
|
+
}
|
|
105604
|
+
}
|
|
105556
105605
|
}
|
|
105557
105606
|
|
|
105558
105607
|
// Core type definitions for the Web Component
|
|
@@ -139988,6 +140037,9 @@ class SplatViewerCore {
|
|
|
139988
140037
|
this._sceneConfigManager = null;
|
|
139989
140038
|
// Event system
|
|
139990
140039
|
this._eventListeners = new Map();
|
|
140040
|
+
// Splat rendering configuration (mirrors key SuperSplat options)
|
|
140041
|
+
this._splatCenterSize = null;
|
|
140042
|
+
this._sphericalHarmonicsBands = null;
|
|
139991
140043
|
this.canvas = options.canvas || null;
|
|
139992
140044
|
this.enableStats = options.enableStats || false;
|
|
139993
140045
|
this.autoFocus = options.autoFocus !== false;
|
|
@@ -140115,6 +140167,8 @@ class SplatViewerCore {
|
|
|
140115
140167
|
// This ensures the loading spinner stays visible until the model is actually rendered
|
|
140116
140168
|
return await new Promise(resolve => {
|
|
140117
140169
|
this.app.once('frameupdate', () => {
|
|
140170
|
+
// Apply any pending splat rendering configuration
|
|
140171
|
+
this._applySplatRenderingConfigToEntity(result.entity);
|
|
140118
140172
|
if (this.autoFocus) {
|
|
140119
140173
|
this.focus(result.entity);
|
|
140120
140174
|
setTimeout(() => {
|
|
@@ -140205,6 +140259,8 @@ class SplatViewerCore {
|
|
|
140205
140259
|
// This ensures the loading spinner stays visible until the model is actually rendered
|
|
140206
140260
|
return await new Promise(resolve => {
|
|
140207
140261
|
this.app.once('frameupdate', () => {
|
|
140262
|
+
// Apply any pending splat rendering configuration
|
|
140263
|
+
this._applySplatRenderingConfigToEntity(entity);
|
|
140208
140264
|
if (this.autoFocus) {
|
|
140209
140265
|
this.focus(entity);
|
|
140210
140266
|
setTimeout(() => {
|
|
@@ -140338,7 +140394,12 @@ class SplatViewerCore {
|
|
|
140338
140394
|
if (!this._modelManager) {
|
|
140339
140395
|
throw new Error('SplatViewerCore.addModel: ModelManager not initialized');
|
|
140340
140396
|
}
|
|
140341
|
-
|
|
140397
|
+
const info = await this._modelManager.addModel(source, options);
|
|
140398
|
+
// Apply any pending splat rendering configuration to the new model entity
|
|
140399
|
+
if (info?.entity) {
|
|
140400
|
+
this._applySplatRenderingConfigToEntity(info.entity);
|
|
140401
|
+
}
|
|
140402
|
+
return info;
|
|
140342
140403
|
}
|
|
140343
140404
|
/**
|
|
140344
140405
|
* Remove a specific model from the scene
|
|
@@ -140400,6 +140461,194 @@ class SplatViewerCore {
|
|
|
140400
140461
|
}
|
|
140401
140462
|
return this._modelManager.getSceneStats();
|
|
140402
140463
|
}
|
|
140464
|
+
/**
|
|
140465
|
+
* Set fly camera base movement speed (convenience over setFlyCameraConfig)
|
|
140466
|
+
* @param speed Units per second (must be > 0)
|
|
140467
|
+
*/
|
|
140468
|
+
setFlyCameraSpeed(speed) {
|
|
140469
|
+
if (speed <= 0 || !isFinite(speed)) {
|
|
140470
|
+
console.warn('SplatViewerCore.setFlyCameraSpeed: speed must be > 0');
|
|
140471
|
+
return;
|
|
140472
|
+
}
|
|
140473
|
+
this.setFlyCameraConfig({ moveSpeed: speed });
|
|
140474
|
+
}
|
|
140475
|
+
/**
|
|
140476
|
+
* Get current fly camera base movement speed
|
|
140477
|
+
* @returns Speed in units per second, or null if fly camera not initialized
|
|
140478
|
+
*/
|
|
140479
|
+
getFlyCameraSpeed() {
|
|
140480
|
+
const cfg = this.getFlyCameraConfig();
|
|
140481
|
+
return cfg ? cfg.moveSpeed : null;
|
|
140482
|
+
}
|
|
140483
|
+
/**
|
|
140484
|
+
* Set visibility for a specific model by ID
|
|
140485
|
+
* @param modelId ID of the model
|
|
140486
|
+
* @param visible True to show, false to hide
|
|
140487
|
+
*/
|
|
140488
|
+
setModelVisible(modelId, visible) {
|
|
140489
|
+
if (!this._modelManager) {
|
|
140490
|
+
throw new Error('SplatViewerCore.setModelVisible: ModelManager not initialized');
|
|
140491
|
+
}
|
|
140492
|
+
this._modelManager.setModelVisible(modelId, visible);
|
|
140493
|
+
}
|
|
140494
|
+
/**
|
|
140495
|
+
* Set visibility for all models matching a given name
|
|
140496
|
+
* @param name Model name to match (case-sensitive)
|
|
140497
|
+
* @param visible True to show, false to hide
|
|
140498
|
+
*/
|
|
140499
|
+
setModelsVisibleByName(name, visible) {
|
|
140500
|
+
if (!this._modelManager) {
|
|
140501
|
+
throw new Error('SplatViewerCore.setModelsVisibleByName: ModelManager not initialized');
|
|
140502
|
+
}
|
|
140503
|
+
this._modelManager.setModelsVisibleByName(name, visible);
|
|
140504
|
+
}
|
|
140505
|
+
// ==========================================
|
|
140506
|
+
// Splat Rendering Configuration
|
|
140507
|
+
// ==========================================
|
|
140508
|
+
/**
|
|
140509
|
+
* Set rendered centers size for all splat models.
|
|
140510
|
+
* This maps onto underlying gsplat / renderer properties when available.
|
|
140511
|
+
* @param size Positive size value (implementation-specific units)
|
|
140512
|
+
*/
|
|
140513
|
+
setSplatCenterSize(size) {
|
|
140514
|
+
if (!isFinite(size) || size <= 0) {
|
|
140515
|
+
console.warn('SplatViewerCore.setSplatCenterSize: size must be > 0');
|
|
140516
|
+
return;
|
|
140517
|
+
}
|
|
140518
|
+
const previousSize = this._splatCenterSize;
|
|
140519
|
+
this._splatCenterSize = size;
|
|
140520
|
+
this._forEachSplatEntity(entity => {
|
|
140521
|
+
this._applySplatRenderingConfigToEntity(entity);
|
|
140522
|
+
});
|
|
140523
|
+
// Emit event for UI integrations
|
|
140524
|
+
this.emit({
|
|
140525
|
+
type: 'splat-center-size-changed',
|
|
140526
|
+
detail: {
|
|
140527
|
+
size,
|
|
140528
|
+
previousSize: previousSize ?? size,
|
|
140529
|
+
},
|
|
140530
|
+
});
|
|
140531
|
+
}
|
|
140532
|
+
/**
|
|
140533
|
+
* Get current centers size value last set via API.
|
|
140534
|
+
* Returns null if not configured yet.
|
|
140535
|
+
*/
|
|
140536
|
+
getSplatCenterSize() {
|
|
140537
|
+
return this._splatCenterSize;
|
|
140538
|
+
}
|
|
140539
|
+
/**
|
|
140540
|
+
* Set spherical harmonics bands for all splat models.
|
|
140541
|
+
* @param bands Integer band count (0-3)
|
|
140542
|
+
*/
|
|
140543
|
+
setSphericalHarmonicsBands(bands) {
|
|
140544
|
+
if (!isFinite(bands)) {
|
|
140545
|
+
console.warn('SplatViewerCore.setSphericalHarmonicsBands: bands must be a finite number');
|
|
140546
|
+
return;
|
|
140547
|
+
}
|
|
140548
|
+
const clamped = Math.max(0, Math.min(3, Math.round(bands)));
|
|
140549
|
+
const previousBands = this._sphericalHarmonicsBands;
|
|
140550
|
+
this._sphericalHarmonicsBands = clamped;
|
|
140551
|
+
this._forEachSplatEntity(entity => {
|
|
140552
|
+
this._applySplatRenderingConfigToEntity(entity);
|
|
140553
|
+
});
|
|
140554
|
+
// Emit event for UI integrations
|
|
140555
|
+
this.emit({
|
|
140556
|
+
type: 'spherical-harmonics-bands-changed',
|
|
140557
|
+
detail: {
|
|
140558
|
+
bands: clamped,
|
|
140559
|
+
previousBands: previousBands ?? clamped,
|
|
140560
|
+
},
|
|
140561
|
+
});
|
|
140562
|
+
}
|
|
140563
|
+
/**
|
|
140564
|
+
* Get current spherical harmonics bands setting last configured via API.
|
|
140565
|
+
* Returns null if not configured yet.
|
|
140566
|
+
*/
|
|
140567
|
+
getSphericalHarmonicsBands() {
|
|
140568
|
+
return this._sphericalHarmonicsBands;
|
|
140569
|
+
}
|
|
140570
|
+
// Apply stored rendering configuration to a specific splat entity
|
|
140571
|
+
_applySplatRenderingConfigToEntity(entity) {
|
|
140572
|
+
const anyEntity = entity;
|
|
140573
|
+
const comp = anyEntity.gsplat;
|
|
140574
|
+
if (!comp)
|
|
140575
|
+
return;
|
|
140576
|
+
// Centers size – try several known/likely property names
|
|
140577
|
+
if (this._splatCenterSize != null) {
|
|
140578
|
+
const size = this._splatCenterSize;
|
|
140579
|
+
if ('centerSize' in comp)
|
|
140580
|
+
comp.centerSize = size;
|
|
140581
|
+
if ('centersSize' in comp)
|
|
140582
|
+
comp.centersSize = size;
|
|
140583
|
+
if ('pointSize' in comp)
|
|
140584
|
+
comp.pointSize = size;
|
|
140585
|
+
if (comp.settings) {
|
|
140586
|
+
if ('centerSize' in comp.settings)
|
|
140587
|
+
comp.settings.centerSize = size;
|
|
140588
|
+
if ('centersSize' in comp.settings)
|
|
140589
|
+
comp.settings.centersSize = size;
|
|
140590
|
+
if ('pointSize' in comp.settings)
|
|
140591
|
+
comp.settings.pointSize = size;
|
|
140592
|
+
}
|
|
140593
|
+
if (comp.instance) {
|
|
140594
|
+
if ('centerSize' in comp.instance)
|
|
140595
|
+
comp.instance.centerSize = size;
|
|
140596
|
+
if ('centersSize' in comp.instance)
|
|
140597
|
+
comp.instance.centersSize = size;
|
|
140598
|
+
if ('pointSize' in comp.instance)
|
|
140599
|
+
comp.instance.pointSize = size;
|
|
140600
|
+
if (comp.instance.renderOptions) {
|
|
140601
|
+
const ro = comp.instance.renderOptions;
|
|
140602
|
+
if ('centerSize' in ro)
|
|
140603
|
+
ro.centerSize = size;
|
|
140604
|
+
if ('centersSize' in ro)
|
|
140605
|
+
ro.centersSize = size;
|
|
140606
|
+
if ('pointSize' in ro)
|
|
140607
|
+
ro.pointSize = size;
|
|
140608
|
+
}
|
|
140609
|
+
}
|
|
140610
|
+
}
|
|
140611
|
+
// Spherical harmonics bands – prefer integer band count properties
|
|
140612
|
+
if (this._sphericalHarmonicsBands != null) {
|
|
140613
|
+
const bands = this._sphericalHarmonicsBands;
|
|
140614
|
+
if ('shBands' in comp)
|
|
140615
|
+
comp.shBands = bands;
|
|
140616
|
+
if ('shBandCount' in comp)
|
|
140617
|
+
comp.shBandCount = bands;
|
|
140618
|
+
if ('sphericalHarmonicsBands' in comp)
|
|
140619
|
+
comp.sphericalHarmonicsBands = bands;
|
|
140620
|
+
if (comp.settings) {
|
|
140621
|
+
if ('shBands' in comp.settings)
|
|
140622
|
+
comp.settings.shBands = bands;
|
|
140623
|
+
if ('shBandCount' in comp.settings)
|
|
140624
|
+
comp.settings.shBandCount = bands;
|
|
140625
|
+
if ('sphericalHarmonicsBands' in comp.settings)
|
|
140626
|
+
comp.settings.sphericalHarmonicsBands = bands;
|
|
140627
|
+
}
|
|
140628
|
+
if (comp.instance) {
|
|
140629
|
+
if ('shBands' in comp.instance)
|
|
140630
|
+
comp.instance.shBands = bands;
|
|
140631
|
+
if ('shBandCount' in comp.instance)
|
|
140632
|
+
comp.instance.shBandCount = bands;
|
|
140633
|
+
if ('sphericalHarmonicsBands' in comp.instance)
|
|
140634
|
+
comp.instance.sphericalHarmonicsBands = bands;
|
|
140635
|
+
}
|
|
140636
|
+
}
|
|
140637
|
+
}
|
|
140638
|
+
// Helper: iterate over all splat entities managed by this core
|
|
140639
|
+
_forEachSplatEntity(fn) {
|
|
140640
|
+
if (this.entities.splat) {
|
|
140641
|
+
fn(this.entities.splat);
|
|
140642
|
+
}
|
|
140643
|
+
if (this._modelManager) {
|
|
140644
|
+
const models = this._modelManager.getModels();
|
|
140645
|
+
for (const m of models) {
|
|
140646
|
+
if (m.entity) {
|
|
140647
|
+
fn(m.entity);
|
|
140648
|
+
}
|
|
140649
|
+
}
|
|
140650
|
+
}
|
|
140651
|
+
}
|
|
140403
140652
|
// ==========================================
|
|
140404
140653
|
// Transform System API
|
|
140405
140654
|
// ==========================================
|
|
@@ -141681,6 +141930,13 @@ class SplatViewerElement extends HTMLElement {
|
|
|
141681
141930
|
this._core.on('background-color-changed', (event) => {
|
|
141682
141931
|
this.dispatchEvent(createCustomEvent('background-color-changed', event.detail));
|
|
141683
141932
|
});
|
|
141933
|
+
// Splat rendering configuration events
|
|
141934
|
+
this._core.on('splat-center-size-changed', (event) => {
|
|
141935
|
+
this.dispatchEvent(createCustomEvent('splat-center-size-changed', event.detail));
|
|
141936
|
+
});
|
|
141937
|
+
this._core.on('spherical-harmonics-bands-changed', (event) => {
|
|
141938
|
+
this.dispatchEvent(createCustomEvent('spherical-harmonics-bands-changed', event.detail));
|
|
141939
|
+
});
|
|
141684
141940
|
// Multi-model management events
|
|
141685
141941
|
this._core.on('model-added', (event) => {
|
|
141686
141942
|
this.dispatchEvent(createCustomEvent('model-added', event.detail));
|
|
@@ -141892,6 +142148,28 @@ class SplatViewerElement extends HTMLElement {
|
|
|
141892
142148
|
}
|
|
141893
142149
|
return this._core.getSceneStats();
|
|
141894
142150
|
}
|
|
142151
|
+
/**
|
|
142152
|
+
* Set visibility for a specific model by ID
|
|
142153
|
+
* @param modelId ID of the model
|
|
142154
|
+
* @param visible True to show, false to hide
|
|
142155
|
+
*/
|
|
142156
|
+
setModelVisible(modelId, visible) {
|
|
142157
|
+
if (!this._core) {
|
|
142158
|
+
throw new Error('SplatViewerElement: Core not initialized. Call connectedCallback first.');
|
|
142159
|
+
}
|
|
142160
|
+
this._core.setModelVisible(modelId, visible);
|
|
142161
|
+
}
|
|
142162
|
+
/**
|
|
142163
|
+
* Set visibility for all models matching a given name
|
|
142164
|
+
* @param name Model name to match (case-sensitive)
|
|
142165
|
+
* @param visible True to show, false to hide
|
|
142166
|
+
*/
|
|
142167
|
+
setModelsVisibleByName(name, visible) {
|
|
142168
|
+
if (!this._core) {
|
|
142169
|
+
throw new Error('SplatViewerElement: Core not initialized. Call connectedCallback first.');
|
|
142170
|
+
}
|
|
142171
|
+
this._core.setModelsVisibleByName(name, visible);
|
|
142172
|
+
}
|
|
141895
142173
|
// ==========================================
|
|
141896
142174
|
// Camera Mode / Fly Camera API
|
|
141897
142175
|
// ==========================================
|
|
@@ -141946,6 +142224,26 @@ class SplatViewerElement extends HTMLElement {
|
|
|
141946
142224
|
}
|
|
141947
142225
|
await this._core.animateCameraFOV(targetFOV, duration);
|
|
141948
142226
|
}
|
|
142227
|
+
/**
|
|
142228
|
+
* Set fly camera base movement speed (convenience over setFlyCameraConfig)
|
|
142229
|
+
* @param speed Units per second (must be > 0)
|
|
142230
|
+
*/
|
|
142231
|
+
setFlyCameraSpeed(speed) {
|
|
142232
|
+
if (!this._core) {
|
|
142233
|
+
throw new Error('SplatViewerElement: Core not initialized. Call connectedCallback first.');
|
|
142234
|
+
}
|
|
142235
|
+
this._core.setFlyCameraSpeed(speed);
|
|
142236
|
+
}
|
|
142237
|
+
/**
|
|
142238
|
+
* Get current fly camera base movement speed
|
|
142239
|
+
* @returns Speed in units per second, or null if fly camera not initialized
|
|
142240
|
+
*/
|
|
142241
|
+
getFlyCameraSpeed() {
|
|
142242
|
+
if (!this._core) {
|
|
142243
|
+
throw new Error('SplatViewerElement: Core not initialized. Call connectedCallback first.');
|
|
142244
|
+
}
|
|
142245
|
+
return this._core.getFlyCameraSpeed();
|
|
142246
|
+
}
|
|
141949
142247
|
setBackgroundColor(color) {
|
|
141950
142248
|
if (!this._core) {
|
|
141951
142249
|
throw new Error('SplatViewerElement: Core not initialized. Call connectedCallback first.');
|
|
@@ -141964,6 +142262,44 @@ class SplatViewerElement extends HTMLElement {
|
|
|
141964
142262
|
}
|
|
141965
142263
|
await this._core.animateBackgroundColor(targetColor, duration);
|
|
141966
142264
|
}
|
|
142265
|
+
/**
|
|
142266
|
+
* Set rendered centers size for all splat models
|
|
142267
|
+
* @param size Positive size value (implementation-specific units)
|
|
142268
|
+
*/
|
|
142269
|
+
setSplatCenterSize(size) {
|
|
142270
|
+
if (!this._core) {
|
|
142271
|
+
throw new Error('SplatViewerElement: Core not initialized. Call connectedCallback first.');
|
|
142272
|
+
}
|
|
142273
|
+
this._core.setSplatCenterSize(size);
|
|
142274
|
+
}
|
|
142275
|
+
/**
|
|
142276
|
+
* Get current centers size value last set via API
|
|
142277
|
+
*/
|
|
142278
|
+
getSplatCenterSize() {
|
|
142279
|
+
if (!this._core) {
|
|
142280
|
+
throw new Error('SplatViewerElement: Core not initialized. Call connectedCallback first.');
|
|
142281
|
+
}
|
|
142282
|
+
return this._core.getSplatCenterSize();
|
|
142283
|
+
}
|
|
142284
|
+
/**
|
|
142285
|
+
* Set spherical harmonics bands for all splat models
|
|
142286
|
+
* @param bands Integer band count (0-3)
|
|
142287
|
+
*/
|
|
142288
|
+
setSphericalHarmonicsBands(bands) {
|
|
142289
|
+
if (!this._core) {
|
|
142290
|
+
throw new Error('SplatViewerElement: Core not initialized. Call connectedCallback first.');
|
|
142291
|
+
}
|
|
142292
|
+
this._core.setSphericalHarmonicsBands(bands);
|
|
142293
|
+
}
|
|
142294
|
+
/**
|
|
142295
|
+
* Get current spherical harmonics bands setting last configured via API
|
|
142296
|
+
*/
|
|
142297
|
+
getSphericalHarmonicsBands() {
|
|
142298
|
+
if (!this._core) {
|
|
142299
|
+
throw new Error('SplatViewerElement: Core not initialized. Call connectedCallback first.');
|
|
142300
|
+
}
|
|
142301
|
+
return this._core.getSphericalHarmonicsBands();
|
|
142302
|
+
}
|
|
141967
142303
|
// ==========================================
|
|
141968
142304
|
// Transform System API
|
|
141969
142305
|
// ==========================================
|