@speridlabs/visus 1.0.3 → 2.0.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/main.d.ts +346 -328
- package/dist/main.es.js +572 -483
- package/dist/main.umd.js +6 -6
- package/dist/react.es.js +745 -656
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -1,328 +1,346 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Simplified bounding box class that tracks min/max points
|
|
5
|
-
*/
|
|
6
|
-
export declare class BoundingBox {
|
|
7
|
-
min: THREE.Vector3;
|
|
8
|
-
max: THREE.Vector3;
|
|
9
|
-
center: THREE.Vector3;
|
|
10
|
-
/** Half extents (size/2) */
|
|
11
|
-
halfExtents: THREE.Vector3;
|
|
12
|
-
/**
|
|
13
|
-
* Reset the bounding box to its initial state
|
|
14
|
-
*/
|
|
15
|
-
reset(): void;
|
|
16
|
-
/**
|
|
17
|
-
* Expand the bounding box to include the given point
|
|
18
|
-
* @param point Point to include in the bounding box
|
|
19
|
-
*/
|
|
20
|
-
expandByPoint(point: THREE.Vector3): void;
|
|
21
|
-
/**
|
|
22
|
-
* Expand this bounding box to include another bounding box
|
|
23
|
-
* @param box Bounding box to include
|
|
24
|
-
*/
|
|
25
|
-
expandByBox(box: BoundingBox): void;
|
|
26
|
-
/**
|
|
27
|
-
* Update the center and half extents based on min/max
|
|
28
|
-
*/
|
|
29
|
-
private updateDerived;
|
|
30
|
-
/**
|
|
31
|
-
* Check if this box contains a point
|
|
32
|
-
* @param point Point to check
|
|
33
|
-
* @returns True if the point is inside the box
|
|
34
|
-
*/
|
|
35
|
-
containsPoint(point: THREE.Vector3): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Create a Three.js Box3 from this bounding box
|
|
38
|
-
* @returns THREE.Box3 representation
|
|
39
|
-
*/
|
|
40
|
-
toBox3(): THREE.Box3;
|
|
41
|
-
/**
|
|
42
|
-
* Create a clone of this bounding box
|
|
43
|
-
* @returns New bounding box with the same values
|
|
44
|
-
*/
|
|
45
|
-
clone(): BoundingBox;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Class for loading PLY files with Gaussian Splat data
|
|
50
|
-
*/
|
|
51
|
-
export declare class PlyLoader extends THREE.Loader {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
* @param
|
|
64
|
-
* @
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
* @
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
*
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
private
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
private
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
*
|
|
205
|
-
* @param
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
*
|
|
211
|
-
* @param
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
*
|
|
218
|
-
* @
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
*
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
*
|
|
266
|
-
* @param
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
*
|
|
314
|
-
* @
|
|
315
|
-
*/
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Create the
|
|
319
|
-
* @param
|
|
320
|
-
* @returns DataTexture
|
|
321
|
-
*/
|
|
322
|
-
private
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Simplified bounding box class that tracks min/max points
|
|
5
|
+
*/
|
|
6
|
+
export declare class BoundingBox {
|
|
7
|
+
min: THREE.Vector3;
|
|
8
|
+
max: THREE.Vector3;
|
|
9
|
+
center: THREE.Vector3;
|
|
10
|
+
/** Half extents (size/2) */
|
|
11
|
+
halfExtents: THREE.Vector3;
|
|
12
|
+
/**
|
|
13
|
+
* Reset the bounding box to its initial state
|
|
14
|
+
*/
|
|
15
|
+
reset(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Expand the bounding box to include the given point
|
|
18
|
+
* @param point Point to include in the bounding box
|
|
19
|
+
*/
|
|
20
|
+
expandByPoint(point: THREE.Vector3): void;
|
|
21
|
+
/**
|
|
22
|
+
* Expand this bounding box to include another bounding box
|
|
23
|
+
* @param box Bounding box to include
|
|
24
|
+
*/
|
|
25
|
+
expandByBox(box: BoundingBox): void;
|
|
26
|
+
/**
|
|
27
|
+
* Update the center and half extents based on min/max
|
|
28
|
+
*/
|
|
29
|
+
private updateDerived;
|
|
30
|
+
/**
|
|
31
|
+
* Check if this box contains a point
|
|
32
|
+
* @param point Point to check
|
|
33
|
+
* @returns True if the point is inside the box
|
|
34
|
+
*/
|
|
35
|
+
containsPoint(point: THREE.Vector3): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Create a Three.js Box3 from this bounding box
|
|
38
|
+
* @returns THREE.Box3 representation
|
|
39
|
+
*/
|
|
40
|
+
toBox3(): THREE.Box3;
|
|
41
|
+
/**
|
|
42
|
+
* Create a clone of this bounding box
|
|
43
|
+
* @returns New bounding box with the same values
|
|
44
|
+
*/
|
|
45
|
+
clone(): BoundingBox;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Class for loading PLY files with Gaussian Splat data
|
|
50
|
+
*/
|
|
51
|
+
export declare class PlyLoader extends THREE.Loader {
|
|
52
|
+
private requestId;
|
|
53
|
+
private worker;
|
|
54
|
+
private pendingCallbacks;
|
|
55
|
+
constructor(manager?: THREE.LoadingManager);
|
|
56
|
+
/**
|
|
57
|
+
* Handles messages received from the parsing worker
|
|
58
|
+
* @param event The message event from the worker
|
|
59
|
+
*/
|
|
60
|
+
private onWorkerMessage;
|
|
61
|
+
/**
|
|
62
|
+
* Load a PLY file with Gaussian Splat data
|
|
63
|
+
* @param url URL of the PLY file
|
|
64
|
+
* @param onLoad Optional callback when loading is complete
|
|
65
|
+
* @param onProgress Optional progress callback
|
|
66
|
+
* @param onError Optional error callback
|
|
67
|
+
*/
|
|
68
|
+
load(url: string, onLoad?: (data: SplatData) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void;
|
|
69
|
+
/**
|
|
70
|
+
* Load a PLY file asynchronously and return a Promise
|
|
71
|
+
* @param url URL of the PLY file
|
|
72
|
+
* @param onProgress Optional progress callback
|
|
73
|
+
* @returns A Promise that resolves with the parsed SplatData
|
|
74
|
+
*/
|
|
75
|
+
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<SplatData>;
|
|
76
|
+
/**
|
|
77
|
+
* Parse PLY buffer data asynchronously using Web Worker
|
|
78
|
+
* @param buffer ArrayBuffer containing PLY data
|
|
79
|
+
* @returns Promise that resolves with parsed SplatData
|
|
80
|
+
*/
|
|
81
|
+
private parseAsync;
|
|
82
|
+
/**
|
|
83
|
+
* Terminate the Web Worker and clean up resources
|
|
84
|
+
*/
|
|
85
|
+
dispose(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Creates the self-contained code for the parsing Web Worker
|
|
88
|
+
* @returns A string containing the JavaScript code for the worker
|
|
89
|
+
*/
|
|
90
|
+
private createWorkerCode;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export declare class SplatData {
|
|
94
|
+
numSplats: number;
|
|
95
|
+
positions: Float32Array;
|
|
96
|
+
rotations: Float32Array;
|
|
97
|
+
scales: Float32Array;
|
|
98
|
+
colors: Float32Array;
|
|
99
|
+
opacities: Float32Array;
|
|
100
|
+
centers: Float32Array;
|
|
101
|
+
boundingBox: BoundingBox;
|
|
102
|
+
constructor(numSplats?: number);
|
|
103
|
+
private allocateBuffers;
|
|
104
|
+
/**
|
|
105
|
+
* Set data for a specific splat
|
|
106
|
+
* @param index Splat index
|
|
107
|
+
* @param position Position vector
|
|
108
|
+
* @param rotation Quaternion
|
|
109
|
+
* @param scale Scale vector (expects LOG SCALE)
|
|
110
|
+
* @param color Color
|
|
111
|
+
* @param opacity Opacity value
|
|
112
|
+
*/
|
|
113
|
+
setSplat(index: number, position: THREE.Vector3, rotation: THREE.Quaternion, scale: THREE.Vector3, color: THREE.Color, opacity: number): void;
|
|
114
|
+
/**
|
|
115
|
+
* Get a splat's data
|
|
116
|
+
* @param index Splat index
|
|
117
|
+
* @returns Object containing splat data (linear scale)
|
|
118
|
+
*/
|
|
119
|
+
getSplat(index: number): {
|
|
120
|
+
position: THREE.Vector3;
|
|
121
|
+
rotation: THREE.Quaternion;
|
|
122
|
+
scale: THREE.Vector3;
|
|
123
|
+
color: THREE.Color;
|
|
124
|
+
opacity: number;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Calculate the bounding box for all splats
|
|
128
|
+
* NOTE: Currently it only uses positions, not the actual splat bounds
|
|
129
|
+
*/
|
|
130
|
+
calculateBoundingBox(): BoundingBox;
|
|
131
|
+
/**
|
|
132
|
+
* Create a Three.js BufferGeometry from this splat data
|
|
133
|
+
* This is for visualization/debugging purposes only, not for rendering
|
|
134
|
+
*/
|
|
135
|
+
createDebugGeometry(): THREE.BufferGeometry;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export declare class SplatMaterial extends THREE.ShaderMaterial {
|
|
139
|
+
constructor(options?: SplatMaterialOptions);
|
|
140
|
+
/**
|
|
141
|
+
* Update the viewport size
|
|
142
|
+
* @param width Viewport width
|
|
143
|
+
* @param height Viewport height
|
|
144
|
+
*/
|
|
145
|
+
updateViewport(width: number, height: number): void;
|
|
146
|
+
/**
|
|
147
|
+
* Set transform texture A (positions)
|
|
148
|
+
* @param texture Texture containing positions
|
|
149
|
+
*/
|
|
150
|
+
setTransformA(texture: THREE.Texture): void;
|
|
151
|
+
/**
|
|
152
|
+
* Set transform texture B (rotation, scale)
|
|
153
|
+
* @param texture Texture containing rotation and scale data
|
|
154
|
+
*/
|
|
155
|
+
setTransformB(texture: THREE.Texture): void;
|
|
156
|
+
/**
|
|
157
|
+
* Set color texture
|
|
158
|
+
* @param texture Texture containing colors
|
|
159
|
+
*/
|
|
160
|
+
setColorTexture(texture: THREE.Texture): void;
|
|
161
|
+
/**
|
|
162
|
+
* Set order texture
|
|
163
|
+
* @param texture Texture containing sort order
|
|
164
|
+
*/
|
|
165
|
+
setOrderTexture(texture: THREE.Texture): void;
|
|
166
|
+
/**
|
|
167
|
+
* Set number of splats to render
|
|
168
|
+
* @param count Number of splats
|
|
169
|
+
*/
|
|
170
|
+
setNumSplats(count: number): void;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export declare interface SplatMaterialOptions {
|
|
174
|
+
alphaTest?: number;
|
|
175
|
+
alphaHash?: boolean;
|
|
176
|
+
toneMapped?: boolean;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* A mesh that renders Gaussian splats
|
|
181
|
+
* Not a real MESH, but a custom geometry with instancing
|
|
182
|
+
*/
|
|
183
|
+
export declare class SplatMesh extends THREE.Mesh {
|
|
184
|
+
sorter: SplatSorter;
|
|
185
|
+
splatData: SplatData;
|
|
186
|
+
options: SplatMeshOptions;
|
|
187
|
+
textureManager: TextureManager;
|
|
188
|
+
material: SplatMaterial;
|
|
189
|
+
geometry: THREE.InstancedBufferGeometry;
|
|
190
|
+
private lastCameraPositionLocal;
|
|
191
|
+
private lastCameraDirectionLocal;
|
|
192
|
+
private invModelMatrix;
|
|
193
|
+
private _vpW;
|
|
194
|
+
private _vpH;
|
|
195
|
+
private _size;
|
|
196
|
+
private _camPosW;
|
|
197
|
+
private _camDirW;
|
|
198
|
+
private _camPosL;
|
|
199
|
+
private _camDirL;
|
|
200
|
+
/** Number of splats combined into a single instanced draw call. */
|
|
201
|
+
private static INSTANCE_SIZE;
|
|
202
|
+
/**
|
|
203
|
+
* Create a new SplatMesh for rendering Gaussian splats
|
|
204
|
+
* @param splatData The splat data to render
|
|
205
|
+
* @param options Rendering options
|
|
206
|
+
*/
|
|
207
|
+
constructor(splatData: SplatData, options?: SplatMeshOptions);
|
|
208
|
+
private onSorterUpdated;
|
|
209
|
+
/**
|
|
210
|
+
* Creates the instanced geometry for rendering splats.
|
|
211
|
+
* @param totalSplats Total number of splats in the data.
|
|
212
|
+
* @param instanceSize Number of splats per instance.
|
|
213
|
+
* @returns InstancedBufferGeometry
|
|
214
|
+
*/
|
|
215
|
+
private static createInstancedGeometry;
|
|
216
|
+
/**
|
|
217
|
+
* Create chunks data (bounding box min/max) for the sorter.
|
|
218
|
+
* @returns Float32Array containing chunk data [minX, minY, minZ, maxX, maxY, maxZ] or null.
|
|
219
|
+
*/
|
|
220
|
+
private createChunks;
|
|
221
|
+
/**
|
|
222
|
+
* Update the viewport size
|
|
223
|
+
* @param width Viewport width
|
|
224
|
+
* @param height Viewport height
|
|
225
|
+
*/
|
|
226
|
+
updateViewport(width: number, height: number): void;
|
|
227
|
+
/**
|
|
228
|
+
* Sorts splats based on camera position and direction.
|
|
229
|
+
* @param camera The camera to sort against.
|
|
230
|
+
*/
|
|
231
|
+
sort(camera: THREE.Camera): void;
|
|
232
|
+
/**
|
|
233
|
+
* THREE.js hook called before rendering the object.
|
|
234
|
+
* Used here to trigger sorting and update viewport.
|
|
235
|
+
* @param renderer The renderer
|
|
236
|
+
* @param scene The scene
|
|
237
|
+
* @param camera The camera
|
|
238
|
+
*/
|
|
239
|
+
onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera): void;
|
|
240
|
+
/**
|
|
241
|
+
* Dispose of resources
|
|
242
|
+
*/
|
|
243
|
+
dispose(): void;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export declare interface SplatMeshOptions extends SplatMaterialOptions {
|
|
247
|
+
autoSort?: boolean;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Manages sorting of splats based on camera view using a Web Worker.
|
|
252
|
+
*/
|
|
253
|
+
export declare class SplatSorter extends THREE.EventDispatcher<{
|
|
254
|
+
updated: SplatSortUpdateEvent;
|
|
255
|
+
}> {
|
|
256
|
+
private worker;
|
|
257
|
+
private centers;
|
|
258
|
+
private orderTexture;
|
|
259
|
+
/** Bounding box data for optimization */
|
|
260
|
+
private chunks;
|
|
261
|
+
private lastCameraPosition;
|
|
262
|
+
private lastCameraDirection;
|
|
263
|
+
constructor();
|
|
264
|
+
/**
|
|
265
|
+
* Handles messages received from the sorting worker.
|
|
266
|
+
* @param event The message event from the worker.
|
|
267
|
+
*/
|
|
268
|
+
private onWorkerMessage;
|
|
269
|
+
/**
|
|
270
|
+
* Initializes the sorter with necessary data and textures.
|
|
271
|
+
* @param orderTexture The THREE.DataTexture (R32UI) to store the sorted splat indices.
|
|
272
|
+
* @param centers A Float32Array containing the center position (x, y, z) for each splat.
|
|
273
|
+
* @param chunks Optional: A Float32Array containing bounding box chunk data [minX, minY, minZ, maxX, maxY, maxZ, ...] for optimization.
|
|
274
|
+
*/
|
|
275
|
+
init(orderTexture: THREE.DataTexture, centers: Float32Array, chunks?: Float32Array): void;
|
|
276
|
+
/**
|
|
277
|
+
* Applies an optional mapping to filter or reorder splats before sorting.
|
|
278
|
+
* The sorter will only consider splats whose original indices are present in the mapping.
|
|
279
|
+
* @param mapping A Uint32Array where each element is the *original* index of a splat to include, or null to reset mapping.
|
|
280
|
+
*/
|
|
281
|
+
setMapping(mapping: Uint32Array | null): void;
|
|
282
|
+
/**
|
|
283
|
+
* Updates the camera parameters used for sorting.
|
|
284
|
+
* @param position The camera's position in the sorter's local coordinate space.
|
|
285
|
+
* @param direction The camera's forward direction in the sorter's local coordinate space.
|
|
286
|
+
*/
|
|
287
|
+
setCamera(position: THREE.Vector3, direction: THREE.Vector3): void;
|
|
288
|
+
/**
|
|
289
|
+
* Terminates the Web Worker and cleans up resources.
|
|
290
|
+
*/
|
|
291
|
+
dispose(): void;
|
|
292
|
+
/**
|
|
293
|
+
* Creates the self-contained code for the sorting Web Worker.
|
|
294
|
+
* @returns A string containing the JavaScript code for the worker.
|
|
295
|
+
*/
|
|
296
|
+
private createWorkerCode;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Event dispatched when the sort is updated */
|
|
300
|
+
declare interface SplatSortUpdateEvent extends THREE.Event {
|
|
301
|
+
type: 'updated';
|
|
302
|
+
count: number;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export declare class TextureManager {
|
|
306
|
+
transformA: THREE.DataTexture;
|
|
307
|
+
transformB: THREE.DataTexture;
|
|
308
|
+
colorTexture: THREE.DataTexture;
|
|
309
|
+
orderTexture: THREE.DataTexture;
|
|
310
|
+
textureWidth: number;
|
|
311
|
+
textureHeight: number;
|
|
312
|
+
/**
|
|
313
|
+
* Create a new TextureManager for a set of splats
|
|
314
|
+
* @param splatData The splat data to manage textures for
|
|
315
|
+
*/
|
|
316
|
+
constructor(splatData: SplatData);
|
|
317
|
+
/**
|
|
318
|
+
* Create the transform A texture (positions and quaternion w component)
|
|
319
|
+
* @param splatData The splat data
|
|
320
|
+
* @returns DataTexture containing position data
|
|
321
|
+
*/
|
|
322
|
+
private createTransformATexture;
|
|
323
|
+
/**
|
|
324
|
+
* Create the transform B texture (scale and rotation xyz)
|
|
325
|
+
* @param splatData The splat data
|
|
326
|
+
* @returns DataTexture containing scale and rotation data
|
|
327
|
+
*/
|
|
328
|
+
private createTransformBTexture;
|
|
329
|
+
/**
|
|
330
|
+
* Create the color texture (RGB and opacity)
|
|
331
|
+
* @param splatData The splat data
|
|
332
|
+
* @returns DataTexture containing color data
|
|
333
|
+
*/
|
|
334
|
+
private createColorTexture;
|
|
335
|
+
/**
|
|
336
|
+
* Create the order texture for sorting
|
|
337
|
+
* @param numSplats Number of splats
|
|
338
|
+
* @returns DataTexture for storing order indices
|
|
339
|
+
*/
|
|
340
|
+
private createOrderTexture;
|
|
341
|
+
dispose(): void;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export declare const VERSION = "0.3.0";
|
|
345
|
+
|
|
346
|
+
export { }
|