@ridp/threejs 1.1.6 → 1.2.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.
Files changed (74) hide show
  1. package/dist/{common-BHi3qsZW.cjs → common-C1rNPPkt.cjs} +2 -2
  2. package/dist/{common-fbJUHqlj.js → common-D1_IztgM.js} +1 -1
  3. package/dist/hooks.cjs +1 -1
  4. package/dist/hooks.js +1 -1
  5. package/dist/modelSerialize-5oJb1ka7.js +965 -0
  6. package/dist/modelSerialize-Ds_2KBaA.cjs +5 -0
  7. package/dist/threejs.cjs +1 -1
  8. package/dist/threejs.js +185 -25
  9. package/dist/useGLTFLoader-2awW2QaH.cjs +4 -0
  10. package/dist/{useGLTFLoader-DusnFN5B.js → useGLTFLoader-BBGTGOYm.js} +1800 -1952
  11. package/dist/utils.cjs +1 -1
  12. package/dist/utils.js +9 -7
  13. package/esdoc/ast/source/.external-ecmascript.js.json +2801 -2801
  14. package/esdoc/ast/source/hooks/index.js.json +738 -738
  15. package/esdoc/ast/source/hooks/useGLTFLoader.js.json +9110 -9110
  16. package/esdoc/ast/source/hooks/useObb.js.json +16462 -16462
  17. package/esdoc/ast/source/hooks/useRaycaster.js.json +15555 -15555
  18. package/esdoc/ast/source/hooks/useThreeJs.js.json +52886 -52886
  19. package/esdoc/ast/source/index.js.json +569 -569
  20. package/esdoc/ast/source/instance/IDBCache.js.json +40977 -40977
  21. package/esdoc/ast/source/instance/index.js.json +231 -231
  22. package/esdoc/ast/source/utils/ImageLoader.js.json +7036 -7036
  23. package/esdoc/ast/source/utils/common.js.json +5133 -5133
  24. package/esdoc/ast/source/utils/css3dHelper.js.json +9100 -9100
  25. package/esdoc/ast/source/utils/disposeObject.js.json +5977 -5977
  26. package/esdoc/ast/source/utils/helper.js.json +10521 -10521
  27. package/esdoc/ast/source/utils/index.js.json +907 -907
  28. package/esdoc/badge.svg +17 -17
  29. package/esdoc/class/src/instance/IDBCache.js~IDBCache.html +1299 -1299
  30. package/esdoc/coverage.json +85 -85
  31. package/esdoc/css/github.css +83 -83
  32. package/esdoc/css/identifiers.css +37 -37
  33. package/esdoc/css/manual.css +134 -134
  34. package/esdoc/css/prettify-tomorrow.css +132 -132
  35. package/esdoc/css/search.css +84 -84
  36. package/esdoc/css/source.css +55 -55
  37. package/esdoc/css/style.css +608 -608
  38. package/esdoc/css/test.css +58 -58
  39. package/esdoc/file/src/hooks/index.js.html +75 -75
  40. package/esdoc/file/src/hooks/useGLTFLoader.js.html +75 -75
  41. package/esdoc/file/src/hooks/useObb.js.html +75 -75
  42. package/esdoc/file/src/hooks/useRaycaster.js.html +75 -75
  43. package/esdoc/file/src/hooks/useThreeJs.js.html +75 -75
  44. package/esdoc/file/src/index.js.html +75 -75
  45. package/esdoc/file/src/instance/IDBCache.js.html +75 -75
  46. package/esdoc/file/src/instance/index.js.html +75 -75
  47. package/esdoc/file/src/utils/ImageLoader.js.html +75 -75
  48. package/esdoc/file/src/utils/common.js.html +75 -75
  49. package/esdoc/file/src/utils/css3dHelper.js.html +75 -75
  50. package/esdoc/file/src/utils/disposeObject.js.html +75 -75
  51. package/esdoc/file/src/utils/helper.js.html +75 -75
  52. package/esdoc/file/src/utils/index.js.html +75 -75
  53. package/esdoc/function/index.html +2019 -2019
  54. package/esdoc/identifiers.html +738 -738
  55. package/esdoc/image/badge.svg +17 -17
  56. package/esdoc/image/manual-badge.svg +17 -17
  57. package/esdoc/index.html +153 -153
  58. package/esdoc/index.json +2050 -2050
  59. package/esdoc/script/inherited-summary.js +28 -28
  60. package/esdoc/script/inner-link.js +32 -32
  61. package/esdoc/script/manual.js +12 -12
  62. package/esdoc/script/patch-for-local.js +8 -8
  63. package/esdoc/script/prettify/Apache-License-2.0.txt +202 -202
  64. package/esdoc/script/prettify/prettify.js +46 -46
  65. package/esdoc/script/pretty-print.js +25 -25
  66. package/esdoc/script/search.js +117 -117
  67. package/esdoc/script/search_index.js +571 -571
  68. package/esdoc/script/test-summary.js +54 -54
  69. package/esdoc/source.html +213 -213
  70. package/esdoc/variable/index.html +225 -225
  71. package/package.json +3 -2
  72. package/dist/ImageLoader-CB_URfeZ.js +0 -860
  73. package/dist/ImageLoader-DwvBWW6h.cjs +0 -5
  74. package/dist/useGLTFLoader-BiveFkS6.cjs +0 -4
package/esdoc/index.json CHANGED
@@ -1,2051 +1,2051 @@
1
- [
2
- {
3
- "__docId__": 1,
4
- "kind": "external",
5
- "name": "Infinity",
6
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity",
7
- "memberof": "src/.external-ecmascript.js",
8
- "static": true,
9
- "longname": "src/.external-ecmascript.js~Infinity",
10
- "access": "public",
11
- "description": "",
12
- "builtinExternal": true
13
- },
14
- {
15
- "__docId__": 2,
16
- "kind": "external",
17
- "name": "NaN",
18
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN",
19
- "memberof": "src/.external-ecmascript.js",
20
- "static": true,
21
- "longname": "src/.external-ecmascript.js~NaN",
22
- "access": "public",
23
- "description": "",
24
- "builtinExternal": true
25
- },
26
- {
27
- "__docId__": 3,
28
- "kind": "external",
29
- "name": "undefined",
30
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
31
- "memberof": "src/.external-ecmascript.js",
32
- "static": true,
33
- "longname": "src/.external-ecmascript.js~undefined",
34
- "access": "public",
35
- "description": "",
36
- "builtinExternal": true
37
- },
38
- {
39
- "__docId__": 4,
40
- "kind": "external",
41
- "name": "null",
42
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",
43
- "memberof": "src/.external-ecmascript.js",
44
- "static": true,
45
- "longname": "src/.external-ecmascript.js~null",
46
- "access": "public",
47
- "description": "",
48
- "builtinExternal": true
49
- },
50
- {
51
- "__docId__": 5,
52
- "kind": "external",
53
- "name": "Object",
54
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
55
- "memberof": "src/.external-ecmascript.js",
56
- "static": true,
57
- "longname": "src/.external-ecmascript.js~Object",
58
- "access": "public",
59
- "description": "",
60
- "builtinExternal": true
61
- },
62
- {
63
- "__docId__": 6,
64
- "kind": "external",
65
- "name": "object",
66
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
67
- "memberof": "src/.external-ecmascript.js",
68
- "static": true,
69
- "longname": "src/.external-ecmascript.js~object",
70
- "access": "public",
71
- "description": "",
72
- "builtinExternal": true
73
- },
74
- {
75
- "__docId__": 7,
76
- "kind": "external",
77
- "name": "Function",
78
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
79
- "memberof": "src/.external-ecmascript.js",
80
- "static": true,
81
- "longname": "src/.external-ecmascript.js~Function",
82
- "access": "public",
83
- "description": "",
84
- "builtinExternal": true
85
- },
86
- {
87
- "__docId__": 8,
88
- "kind": "external",
89
- "name": "function",
90
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
91
- "memberof": "src/.external-ecmascript.js",
92
- "static": true,
93
- "longname": "src/.external-ecmascript.js~function",
94
- "access": "public",
95
- "description": "",
96
- "builtinExternal": true
97
- },
98
- {
99
- "__docId__": 9,
100
- "kind": "external",
101
- "name": "Boolean",
102
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
103
- "memberof": "src/.external-ecmascript.js",
104
- "static": true,
105
- "longname": "src/.external-ecmascript.js~Boolean",
106
- "access": "public",
107
- "description": "",
108
- "builtinExternal": true
109
- },
110
- {
111
- "__docId__": 10,
112
- "kind": "external",
113
- "name": "boolean",
114
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
115
- "memberof": "src/.external-ecmascript.js",
116
- "static": true,
117
- "longname": "src/.external-ecmascript.js~boolean",
118
- "access": "public",
119
- "description": "",
120
- "builtinExternal": true
121
- },
122
- {
123
- "__docId__": 11,
124
- "kind": "external",
125
- "name": "Symbol",
126
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol",
127
- "memberof": "src/.external-ecmascript.js",
128
- "static": true,
129
- "longname": "src/.external-ecmascript.js~Symbol",
130
- "access": "public",
131
- "description": "",
132
- "builtinExternal": true
133
- },
134
- {
135
- "__docId__": 12,
136
- "kind": "external",
137
- "name": "Error",
138
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
139
- "memberof": "src/.external-ecmascript.js",
140
- "static": true,
141
- "longname": "src/.external-ecmascript.js~Error",
142
- "access": "public",
143
- "description": "",
144
- "builtinExternal": true
145
- },
146
- {
147
- "__docId__": 13,
148
- "kind": "external",
149
- "name": "EvalError",
150
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError",
151
- "memberof": "src/.external-ecmascript.js",
152
- "static": true,
153
- "longname": "src/.external-ecmascript.js~EvalError",
154
- "access": "public",
155
- "description": "",
156
- "builtinExternal": true
157
- },
158
- {
159
- "__docId__": 14,
160
- "kind": "external",
161
- "name": "InternalError",
162
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError",
163
- "memberof": "src/.external-ecmascript.js",
164
- "static": true,
165
- "longname": "src/.external-ecmascript.js~InternalError",
166
- "access": "public",
167
- "description": "",
168
- "builtinExternal": true
169
- },
170
- {
171
- "__docId__": 15,
172
- "kind": "external",
173
- "name": "RangeError",
174
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError",
175
- "memberof": "src/.external-ecmascript.js",
176
- "static": true,
177
- "longname": "src/.external-ecmascript.js~RangeError",
178
- "access": "public",
179
- "description": "",
180
- "builtinExternal": true
181
- },
182
- {
183
- "__docId__": 16,
184
- "kind": "external",
185
- "name": "ReferenceError",
186
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError",
187
- "memberof": "src/.external-ecmascript.js",
188
- "static": true,
189
- "longname": "src/.external-ecmascript.js~ReferenceError",
190
- "access": "public",
191
- "description": "",
192
- "builtinExternal": true
193
- },
194
- {
195
- "__docId__": 17,
196
- "kind": "external",
197
- "name": "SyntaxError",
198
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError",
199
- "memberof": "src/.external-ecmascript.js",
200
- "static": true,
201
- "longname": "src/.external-ecmascript.js~SyntaxError",
202
- "access": "public",
203
- "description": "",
204
- "builtinExternal": true
205
- },
206
- {
207
- "__docId__": 18,
208
- "kind": "external",
209
- "name": "TypeError",
210
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
211
- "memberof": "src/.external-ecmascript.js",
212
- "static": true,
213
- "longname": "src/.external-ecmascript.js~TypeError",
214
- "access": "public",
215
- "description": "",
216
- "builtinExternal": true
217
- },
218
- {
219
- "__docId__": 19,
220
- "kind": "external",
221
- "name": "URIError",
222
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError",
223
- "memberof": "src/.external-ecmascript.js",
224
- "static": true,
225
- "longname": "src/.external-ecmascript.js~URIError",
226
- "access": "public",
227
- "description": "",
228
- "builtinExternal": true
229
- },
230
- {
231
- "__docId__": 20,
232
- "kind": "external",
233
- "name": "Number",
234
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
235
- "memberof": "src/.external-ecmascript.js",
236
- "static": true,
237
- "longname": "src/.external-ecmascript.js~Number",
238
- "access": "public",
239
- "description": "",
240
- "builtinExternal": true
241
- },
242
- {
243
- "__docId__": 21,
244
- "kind": "external",
245
- "name": "number",
246
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
247
- "memberof": "src/.external-ecmascript.js",
248
- "static": true,
249
- "longname": "src/.external-ecmascript.js~number",
250
- "access": "public",
251
- "description": "",
252
- "builtinExternal": true
253
- },
254
- {
255
- "__docId__": 22,
256
- "kind": "external",
257
- "name": "Date",
258
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
259
- "memberof": "src/.external-ecmascript.js",
260
- "static": true,
261
- "longname": "src/.external-ecmascript.js~Date",
262
- "access": "public",
263
- "description": "",
264
- "builtinExternal": true
265
- },
266
- {
267
- "__docId__": 23,
268
- "kind": "external",
269
- "name": "String",
270
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
271
- "memberof": "src/.external-ecmascript.js",
272
- "static": true,
273
- "longname": "src/.external-ecmascript.js~String",
274
- "access": "public",
275
- "description": "",
276
- "builtinExternal": true
277
- },
278
- {
279
- "__docId__": 24,
280
- "kind": "external",
281
- "name": "string",
282
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
283
- "memberof": "src/.external-ecmascript.js",
284
- "static": true,
285
- "longname": "src/.external-ecmascript.js~string",
286
- "access": "public",
287
- "description": "",
288
- "builtinExternal": true
289
- },
290
- {
291
- "__docId__": 25,
292
- "kind": "external",
293
- "name": "RegExp",
294
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
295
- "memberof": "src/.external-ecmascript.js",
296
- "static": true,
297
- "longname": "src/.external-ecmascript.js~RegExp",
298
- "access": "public",
299
- "description": "",
300
- "builtinExternal": true
301
- },
302
- {
303
- "__docId__": 26,
304
- "kind": "external",
305
- "name": "Array",
306
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
307
- "memberof": "src/.external-ecmascript.js",
308
- "static": true,
309
- "longname": "src/.external-ecmascript.js~Array",
310
- "access": "public",
311
- "description": "",
312
- "builtinExternal": true
313
- },
314
- {
315
- "__docId__": 27,
316
- "kind": "external",
317
- "name": "Int8Array",
318
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",
319
- "memberof": "src/.external-ecmascript.js",
320
- "static": true,
321
- "longname": "src/.external-ecmascript.js~Int8Array",
322
- "access": "public",
323
- "description": "",
324
- "builtinExternal": true
325
- },
326
- {
327
- "__docId__": 28,
328
- "kind": "external",
329
- "name": "Uint8Array",
330
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",
331
- "memberof": "src/.external-ecmascript.js",
332
- "static": true,
333
- "longname": "src/.external-ecmascript.js~Uint8Array",
334
- "access": "public",
335
- "description": "",
336
- "builtinExternal": true
337
- },
338
- {
339
- "__docId__": 29,
340
- "kind": "external",
341
- "name": "Uint8ClampedArray",
342
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",
343
- "memberof": "src/.external-ecmascript.js",
344
- "static": true,
345
- "longname": "src/.external-ecmascript.js~Uint8ClampedArray",
346
- "access": "public",
347
- "description": "",
348
- "builtinExternal": true
349
- },
350
- {
351
- "__docId__": 30,
352
- "kind": "external",
353
- "name": "Int16Array",
354
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",
355
- "memberof": "src/.external-ecmascript.js",
356
- "static": true,
357
- "longname": "src/.external-ecmascript.js~Int16Array",
358
- "access": "public",
359
- "description": "",
360
- "builtinExternal": true
361
- },
362
- {
363
- "__docId__": 31,
364
- "kind": "external",
365
- "name": "Uint16Array",
366
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",
367
- "memberof": "src/.external-ecmascript.js",
368
- "static": true,
369
- "longname": "src/.external-ecmascript.js~Uint16Array",
370
- "access": "public",
371
- "description": "",
372
- "builtinExternal": true
373
- },
374
- {
375
- "__docId__": 32,
376
- "kind": "external",
377
- "name": "Int32Array",
378
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",
379
- "memberof": "src/.external-ecmascript.js",
380
- "static": true,
381
- "longname": "src/.external-ecmascript.js~Int32Array",
382
- "access": "public",
383
- "description": "",
384
- "builtinExternal": true
385
- },
386
- {
387
- "__docId__": 33,
388
- "kind": "external",
389
- "name": "Uint32Array",
390
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",
391
- "memberof": "src/.external-ecmascript.js",
392
- "static": true,
393
- "longname": "src/.external-ecmascript.js~Uint32Array",
394
- "access": "public",
395
- "description": "",
396
- "builtinExternal": true
397
- },
398
- {
399
- "__docId__": 34,
400
- "kind": "external",
401
- "name": "Float32Array",
402
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",
403
- "memberof": "src/.external-ecmascript.js",
404
- "static": true,
405
- "longname": "src/.external-ecmascript.js~Float32Array",
406
- "access": "public",
407
- "description": "",
408
- "builtinExternal": true
409
- },
410
- {
411
- "__docId__": 35,
412
- "kind": "external",
413
- "name": "Float64Array",
414
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",
415
- "memberof": "src/.external-ecmascript.js",
416
- "static": true,
417
- "longname": "src/.external-ecmascript.js~Float64Array",
418
- "access": "public",
419
- "description": "",
420
- "builtinExternal": true
421
- },
422
- {
423
- "__docId__": 36,
424
- "kind": "external",
425
- "name": "Map",
426
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",
427
- "memberof": "src/.external-ecmascript.js",
428
- "static": true,
429
- "longname": "src/.external-ecmascript.js~Map",
430
- "access": "public",
431
- "description": "",
432
- "builtinExternal": true
433
- },
434
- {
435
- "__docId__": 37,
436
- "kind": "external",
437
- "name": "Set",
438
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",
439
- "memberof": "src/.external-ecmascript.js",
440
- "static": true,
441
- "longname": "src/.external-ecmascript.js~Set",
442
- "access": "public",
443
- "description": "",
444
- "builtinExternal": true
445
- },
446
- {
447
- "__docId__": 38,
448
- "kind": "external",
449
- "name": "WeakMap",
450
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",
451
- "memberof": "src/.external-ecmascript.js",
452
- "static": true,
453
- "longname": "src/.external-ecmascript.js~WeakMap",
454
- "access": "public",
455
- "description": "",
456
- "builtinExternal": true
457
- },
458
- {
459
- "__docId__": 39,
460
- "kind": "external",
461
- "name": "WeakSet",
462
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",
463
- "memberof": "src/.external-ecmascript.js",
464
- "static": true,
465
- "longname": "src/.external-ecmascript.js~WeakSet",
466
- "access": "public",
467
- "description": "",
468
- "builtinExternal": true
469
- },
470
- {
471
- "__docId__": 40,
472
- "kind": "external",
473
- "name": "ArrayBuffer",
474
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",
475
- "memberof": "src/.external-ecmascript.js",
476
- "static": true,
477
- "longname": "src/.external-ecmascript.js~ArrayBuffer",
478
- "access": "public",
479
- "description": "",
480
- "builtinExternal": true
481
- },
482
- {
483
- "__docId__": 41,
484
- "kind": "external",
485
- "name": "DataView",
486
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",
487
- "memberof": "src/.external-ecmascript.js",
488
- "static": true,
489
- "longname": "src/.external-ecmascript.js~DataView",
490
- "access": "public",
491
- "description": "",
492
- "builtinExternal": true
493
- },
494
- {
495
- "__docId__": 42,
496
- "kind": "external",
497
- "name": "JSON",
498
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON",
499
- "memberof": "src/.external-ecmascript.js",
500
- "static": true,
501
- "longname": "src/.external-ecmascript.js~JSON",
502
- "access": "public",
503
- "description": "",
504
- "builtinExternal": true
505
- },
506
- {
507
- "__docId__": 43,
508
- "kind": "external",
509
- "name": "Promise",
510
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
511
- "memberof": "src/.external-ecmascript.js",
512
- "static": true,
513
- "longname": "src/.external-ecmascript.js~Promise",
514
- "access": "public",
515
- "description": "",
516
- "builtinExternal": true
517
- },
518
- {
519
- "__docId__": 44,
520
- "kind": "external",
521
- "name": "Generator",
522
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator",
523
- "memberof": "src/.external-ecmascript.js",
524
- "static": true,
525
- "longname": "src/.external-ecmascript.js~Generator",
526
- "access": "public",
527
- "description": "",
528
- "builtinExternal": true
529
- },
530
- {
531
- "__docId__": 45,
532
- "kind": "external",
533
- "name": "GeneratorFunction",
534
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction",
535
- "memberof": "src/.external-ecmascript.js",
536
- "static": true,
537
- "longname": "src/.external-ecmascript.js~GeneratorFunction",
538
- "access": "public",
539
- "description": "",
540
- "builtinExternal": true
541
- },
542
- {
543
- "__docId__": 46,
544
- "kind": "external",
545
- "name": "Reflect",
546
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect",
547
- "memberof": "src/.external-ecmascript.js",
548
- "static": true,
549
- "longname": "src/.external-ecmascript.js~Reflect",
550
- "access": "public",
551
- "description": "",
552
- "builtinExternal": true
553
- },
554
- {
555
- "__docId__": 47,
556
- "kind": "external",
557
- "name": "Proxy",
558
- "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
559
- "memberof": "src/.external-ecmascript.js",
560
- "static": true,
561
- "longname": "src/.external-ecmascript.js~Proxy",
562
- "access": "public",
563
- "description": "",
564
- "builtinExternal": true
565
- },
566
- {
567
- "__docId__": 48,
568
- "kind": "file",
569
- "name": "src/hooks/index.js",
570
- "content": "export * from \"./useThreeJs\";\r\nexport * from \"./useRaycaster\";\r\nexport * from \"./useObb\";\r\nexport * from \"./useGLTFLoader\";\r\n",
571
- "static": true,
572
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/index.js",
573
- "access": "public",
574
- "description": null,
575
- "lineNumber": 1
576
- },
577
- {
578
- "__docId__": 49,
579
- "kind": "file",
580
- "name": "src/hooks/useGLTFLoader.js",
581
- "content": "import { GLTFLoader } from \"three/addons/loaders/GLTFLoader.js\";\r\nimport { DRACOLoader } from \"three/addons/loaders/DRACOLoader.js\";\r\nimport { IDBCache } from \"../instance/IDBCache\";\r\n\r\n/** @type { IDBCache } */\r\nlet idbCache;\r\n\r\n/**\r\n * GLTFLoader 模型加载器\r\n * @returns { Object }\r\n * @property { Function } load - 模型加载方法\r\n * @property { Function } asyncLoad - Promise 形式异步加载模型方法\r\n * @property { Function } asyncCacheLoad - Promise 形式异步加载模型并缓存方法\r\n */\r\nexport const useGLTFLoader = () => {\r\n const loader = new GLTFLoader();\r\n const dracoLoader = new DRACOLoader();\r\n dracoLoader.setDecoderPath(`/draco/`);\r\n loader.setDRACOLoader(dracoLoader);\r\n\r\n /**\r\n * 模型加载\r\n * @param { String } path - 模型路径\r\n * @param {Function} onLoad - 加载完成回调\r\n * @param {Function} onProgress - 进度回调\r\n * @param {Function} onError - 错误回调\r\n * @returns { GLTFLoader.load }\r\n */\r\n function load(path, onLoad, onProgress, onError) {\r\n return loader.load(path, onLoad, onProgress, onError);\r\n }\r\n\r\n /**\r\n * Promise 形式异步加载模型\r\n * @param {String} path - 模型路径\r\n * @param {Function} onProgress - 进度回调\r\n * @returns\r\n */\r\n function asyncLoad(path, onProgress) {\r\n return new Promise((resolve, reject) => {\r\n loader.load(path, resolve, onProgress, reject);\r\n });\r\n }\r\n\r\n /**\r\n * Promise 形式异步加载模型并缓存\r\n * 使用IndexDb 对加载后的模型文件进行缓存\r\n * 二次访问时直接从缓存中加载, 减少网络请求\r\n * @param {*} path - 模型路径\r\n * @param {*} onProgress - 进度回调\r\n * @returns { Object3D }\r\n */\r\n async function asyncCacheLoad(path, onProgress) {\r\n if (!idbCache) idbCache = new IDBCache();\r\n const cacheObj = await idbCache.loadCachedModel(path);\r\n if (cacheObj) return cacheObj;\r\n\r\n return new Promise((resolve, reject) => {\r\n loader.load(path, resolve, onProgress, reject);\r\n }).then(async (model) => {\r\n await idbCache.cacheModel(path, model.scene);\r\n return model;\r\n });\r\n }\r\n\r\n return {\r\n load,\r\n asyncLoad,\r\n asyncCacheLoad,\r\n };\r\n};\r\n",
582
- "static": true,
583
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/useGLTFLoader.js",
584
- "access": "public",
585
- "description": null,
586
- "lineNumber": 1
587
- },
588
- {
589
- "__docId__": 50,
590
- "kind": "function",
591
- "name": "useGLTFLoader",
592
- "memberof": "src/hooks/useGLTFLoader.js",
593
- "generator": false,
594
- "async": false,
595
- "static": true,
596
- "longname": "src/hooks/useGLTFLoader.js~useGLTFLoader",
597
- "access": "public",
598
- "export": true,
599
- "importPath": "@ridp/threejs/src/hooks/useGLTFLoader.js",
600
- "importStyle": "{useGLTFLoader}",
601
- "description": "GLTFLoader 模型加载器",
602
- "lineNumber": 15,
603
- "unknown": [
604
- {
605
- "tagName": "@returns",
606
- "tagValue": "{ Object }"
607
- }
608
- ],
609
- "properties": [
610
- {
611
- "nullable": null,
612
- "types": [
613
- " Function "
614
- ],
615
- "spread": false,
616
- "optional": false,
617
- "name": "load",
618
- "description": "模型加载方法"
619
- },
620
- {
621
- "nullable": null,
622
- "types": [
623
- " Function "
624
- ],
625
- "spread": false,
626
- "optional": false,
627
- "name": "asyncLoad",
628
- "description": "Promise 形式异步加载模型方法"
629
- },
630
- {
631
- "nullable": null,
632
- "types": [
633
- " Function "
634
- ],
635
- "spread": false,
636
- "optional": false,
637
- "name": "asyncCacheLoad",
638
- "description": "Promise 形式异步加载模型并缓存方法"
639
- }
640
- ],
641
- "return": {
642
- "nullable": null,
643
- "types": [
644
- " Object "
645
- ],
646
- "spread": false,
647
- "description": ""
648
- },
649
- "params": []
650
- },
651
- {
652
- "__docId__": 51,
653
- "kind": "file",
654
- "name": "src/hooks/useObb.js",
655
- "content": "import { Color, Box3, Vector3 } from 'three'\r\nimport { OBB } from 'three/addons'\r\n\r\n// 按parentUid存储obb对象, 用于碰撞检测\r\nexport const obbObjects = []\r\nexport const intersectColor = new Color(0xff0000)\r\n\r\nexport const useObb = () => {\r\n const resetObbs = () => {\r\n obbObjects.splice(0)\r\n }\r\n\r\n const initObb = (parentUid, model) => {\r\n model.traverse((child) => {\r\n // 需要碰撞检测的标记\r\n child && initSingleObbItem(parentUid, child)\r\n })\r\n }\r\n\r\n const initSingleObbItem = (parentUid, model) => {\r\n if (model.userData.needCheck) {\r\n model.autoUpdateMatrix = false\r\n model.updateMatrix()\r\n model.updateMatrixWorld()\r\n if (model.isMesh) {\r\n const box3 = new Box3(new Vector3()).setFromObject(model)\r\n\r\n model.geometry.userData.obb = new OBB()\r\n model.geometry.userData.obb.halfSize.copy(box3.getSize(new Vector3())).multiplyScalar(0.5).multiplyScalar(0.88)\r\n model.userData.obb = new OBB()\r\n\r\n model.userData.originColor = model.material.color.clone()\r\n model.userData.parentUid = parentUid\r\n\r\n obbObjects.push({\r\n object: model,\r\n parentUid: parentUid\r\n })\r\n }\r\n }\r\n }\r\n\r\n const addObbFromArray = (parentUid, arr) => {\r\n for (let i = 0, il = arr.length; i < il; i++) {\r\n initSingleObbItem(parentUid, arr[i])\r\n }\r\n }\r\n\r\n const getObbObjectByParentUid = (parentUid) => {\r\n return obbObjects.filter((item) => item.parentUid === parentUid)\r\n }\r\n\r\n const removeObbFromArray = (obbs) => {\r\n const list = obbObjects.filter((item) => !obbs.includes(item.object))\r\n obbObjects.splice(0, obbObjects.length, ...list)\r\n }\r\n\r\n const removeUidObb = (parentUid) => {\r\n for (let i = obbObjects.length - 1; i >= 0; i--) {\r\n if (obbObjects[i].parentUid === parentUid) {\r\n obbObjects.splice(i, 1)\r\n }\r\n }\r\n }\r\n\r\n return {\r\n resetObbs,\r\n initObb,\r\n getObbObjectByParentUid,\r\n addObbFromArray,\r\n removeObbFromArray,\r\n removeUidObb\r\n }\r\n}\r\n",
656
- "static": true,
657
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/useObb.js",
658
- "access": "public",
659
- "description": null,
660
- "lineNumber": 1
661
- },
662
- {
663
- "__docId__": 52,
664
- "kind": "variable",
665
- "name": "obbObjects",
666
- "memberof": "src/hooks/useObb.js",
667
- "static": true,
668
- "longname": "src/hooks/useObb.js~obbObjects",
669
- "access": "public",
670
- "export": true,
671
- "importPath": "@ridp/threejs/src/hooks/useObb.js",
672
- "importStyle": "{obbObjects}",
673
- "description": null,
674
- "lineNumber": 5,
675
- "undocument": true,
676
- "type": {
677
- "types": [
678
- "*[]"
679
- ]
680
- }
681
- },
682
- {
683
- "__docId__": 53,
684
- "kind": "variable",
685
- "name": "intersectColor",
686
- "memberof": "src/hooks/useObb.js",
687
- "static": true,
688
- "longname": "src/hooks/useObb.js~intersectColor",
689
- "access": "public",
690
- "export": true,
691
- "importPath": "@ridp/threejs/src/hooks/useObb.js",
692
- "importStyle": "{intersectColor}",
693
- "description": null,
694
- "lineNumber": 6,
695
- "undocument": true,
696
- "type": {
697
- "types": [
698
- "*"
699
- ]
700
- }
701
- },
702
- {
703
- "__docId__": 54,
704
- "kind": "function",
705
- "name": "useObb",
706
- "memberof": "src/hooks/useObb.js",
707
- "generator": false,
708
- "async": false,
709
- "static": true,
710
- "longname": "src/hooks/useObb.js~useObb",
711
- "access": "public",
712
- "export": true,
713
- "importPath": "@ridp/threejs/src/hooks/useObb.js",
714
- "importStyle": "{useObb}",
715
- "description": null,
716
- "lineNumber": 8,
717
- "undocument": true,
718
- "params": [],
719
- "return": {
720
- "types": [
721
- "{\"resetObbs\": *, \"initObb\": *, \"getObbObjectByParentUid\": *, \"addObbFromArray\": *, \"removeObbFromArray\": *, \"removeUidObb\": *}"
722
- ]
723
- }
724
- },
725
- {
726
- "__docId__": 55,
727
- "kind": "file",
728
- "name": "src/hooks/useRaycaster.js",
729
- "content": "import { Raycaster, Vector2 } from \"three\";\r\n\r\n// Raycaster\r\nexport const useRaycaster = (appId = \"app\") => {\r\n const raycaster = new Raycaster();\r\n raycaster.params.Line.threshold = 8;\r\n const pointer = new Vector2();\r\n\r\n const $app = document.getElementById(appId);\r\n\r\n /**\r\n * 获取鼠标坐标\r\n * @param {*} event HtmlEvent\r\n * @param {*} container HTMLDomElement\r\n * @returns\r\n */\r\n function getPointer(event, container) {\r\n const { scaleX, scaleY } = getScale($app);\r\n const { clientWidth, clientHeight } = container;\r\n const size = container.getBoundingClientRect();\r\n\r\n const realDomWidth = clientWidth * scaleX;\r\n const realDomHeight = clientHeight * scaleY;\r\n\r\n const x = event.clientX - size.left;\r\n const y = event.clientY - size.top;\r\n pointer.x = ((event.clientX - size.left) / realDomWidth) * 2 - 1;\r\n pointer.y = -((event.clientY - size.top) / realDomHeight) * 2 + 1;\r\n return { pointer, x, y };\r\n }\r\n\r\n /**\r\n * 获取鼠标捕获的对象\r\n * @param {*} event HtmlEvent\r\n * @param {*} renderDom renderer.domElement\r\n * @param {*} camera Camera\r\n * @param {*} catchObjects Objects3D[]\r\n * @returns Objects3D[] || null\r\n */\r\n function getIntersects(event, renderDom, camera, catchObjects) {\r\n const { pointer, x, y } = getPointer(event, renderDom);\r\n raycaster.setFromCamera(pointer, camera);\r\n const intersects = raycaster.intersectObjects(catchObjects);\r\n return { intersects, pointer, x, y };\r\n }\r\n\r\n /**\r\n * 获取 DOM 的缩放比例\r\n * @param {*} element\r\n * @returns\r\n */\r\n function getScale(element) {\r\n const style = window.getComputedStyle(element);\r\n const transform =\r\n style.transform || style.webkitTransform || style.mozTransform;\r\n\r\n if (transform && transform !== \"none\") {\r\n const matrix = transform.match(/^matrix\\((.+)\\)$/);\r\n if (matrix) {\r\n const values = matrix[1].split(\", \");\r\n const scaleX = parseFloat(values[0]);\r\n const scaleY = parseFloat(values[3]);\r\n return { scaleX, scaleY };\r\n }\r\n }\r\n // 如果没有缩放,返回默认值\r\n return { scaleX: 1, scaleY: 1 };\r\n }\r\n\r\n return {\r\n raycaster,\r\n pointer,\r\n\r\n getPointer,\r\n getScale,\r\n getIntersects,\r\n };\r\n};\r\n",
730
- "static": true,
731
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/useRaycaster.js",
732
- "access": "public",
733
- "description": null,
734
- "lineNumber": 1
735
- },
736
- {
737
- "__docId__": 56,
738
- "kind": "function",
739
- "name": "useRaycaster",
740
- "memberof": "src/hooks/useRaycaster.js",
741
- "generator": false,
742
- "async": false,
743
- "static": true,
744
- "longname": "src/hooks/useRaycaster.js~useRaycaster",
745
- "access": "public",
746
- "export": true,
747
- "importPath": "@ridp/threejs/src/hooks/useRaycaster.js",
748
- "importStyle": "{useRaycaster}",
749
- "description": null,
750
- "lineNumber": 4,
751
- "undocument": true,
752
- "params": [
753
- {
754
- "name": "appId",
755
- "optional": true,
756
- "types": [
757
- "string"
758
- ],
759
- "defaultRaw": "app",
760
- "defaultValue": "app"
761
- }
762
- ],
763
- "return": {
764
- "types": [
765
- "{\"raycaster\": *, \"pointer\": *, \"getPointer\": *, \"getScale\": *, \"getIntersects\": *}"
766
- ]
767
- }
768
- },
769
- {
770
- "__docId__": 57,
771
- "kind": "file",
772
- "name": "src/hooks/useThreeJs.js",
773
- "content": "import {\r\n Scene,\r\n Group,\r\n PerspectiveCamera,\r\n WebGLRenderer,\r\n Color,\r\n Box3,\r\n Vector3,\r\n MathUtils,\r\n} from \"three\";\r\nimport { nextTick, onMounted, onUnmounted, ref, shallowRef } from \"vue\";\r\nimport Stats from \"three/addons/libs/stats.module.js\";\r\nimport { CSS3DRenderer } from \"three/examples/jsm/renderers/CSS3DRenderer.js\";\r\n\r\nimport { createOrbitControl, disposeThreeObject } from \"../utils\";\r\nimport { OrbitControls } from \"three/examples/jsm/Addons.js\";\r\nimport { Object3D } from \"three\";\r\n\r\n// 默认控制器配置\r\nconst defaultControlOpt = {\r\n enableDamping: true,\r\n dampingFactor: 0.25,\r\n screenSpacePanning: false,\r\n minDistance: 0.1,\r\n maxDistance: 1000,\r\n maxPolarAngle: MathUtils.degToRad(60),\r\n};\r\n\r\n/**\r\n * \r\n * @param {String} selector ID '#xxxx'\r\n * @param {Object} option {\r\n * css3d: false,\r\n stats: false,\r\n control: {\r\n init: true,\r\n options: {\r\n ...OrbitControls属性\r\n },\r\n },\r\n * }\r\n * @returns any\r\n */\r\nexport function useThreeJs(selector, option) {\r\n const _option = Object.assign(\r\n {\r\n css3d: false,\r\n stats: false,\r\n control: {\r\n init: true,\r\n options: {},\r\n },\r\n },\r\n option || {}\r\n );\r\n\r\n let el,\r\n stats,\r\n css3dRenderer,\r\n animateCbs = [];\r\n\r\n const isReady = ref(false);\r\n\r\n const control = shallowRef();\r\n const domWidth = ref(0);\r\n const domHeight = ref(0);\r\n\r\n const renderer = new WebGLRenderer({\r\n antialias: true,\r\n alpha: true,\r\n precision: \"mediump\",\r\n logarithmicDepthBuffer: true,\r\n });\r\n const scene = new Scene({});\r\n const camera = new PerspectiveCamera(50, 1, 0.1, 2000);\r\n const tanFOV = Math.tan(((Math.PI / 180) * camera.fov) / 2);\r\n\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n\r\n function init() {\r\n isReady.value = false;\r\n const size = getTargetSize();\r\n domWidth.value = size[0];\r\n domHeight.value = size[1];\r\n\r\n camera.aspect = domWidth.value / domHeight.value;\r\n camera.position.set(47, 39, 100);\r\n camera.fov =\r\n (360 / Math.PI) * Math.atan(tanFOV * (domHeight.value / domWidth.value));\r\n camera.lookAt(0, 0, 0);\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(domWidth.value, domHeight.value);\r\n el.appendChild(renderer.domElement);\r\n\r\n _option.stats && initStats();\r\n // css3d\r\n _option.css3d && createCss3dRenderer();\r\n\r\n // 控制器\r\n let control;\r\n if (_option.control && _option.control.init) {\r\n control = createOrbitControl(camera, renderer.domElement);\r\n const controlOpt = Object.assign(\r\n defaultControlOpt,\r\n _option.control.options || {}\r\n );\r\n Object.keys(controlOpt).forEach((key) => {\r\n control[key] = controlOpt[key];\r\n });\r\n }\r\n\r\n nextTick(() => (isReady.value = true));\r\n return control;\r\n }\r\n\r\n function onContextLost(event) {\r\n event.preventDefault();\r\n cancelAnimationFrame(animate);\r\n }\r\n function onContextRestored(event) {\r\n event.preventDefault();\r\n init();\r\n animate();\r\n }\r\n\r\n /**\r\n * 循环帧中添加执行函数\r\n * @param {*} animate \r\n */\r\n function addAnimate(animate) {\r\n animateCbs.push(animate);\r\n }\r\n\r\n function animate(cbs) {\r\n animateCbs &&\r\n animateCbs.length &&\r\n animateCbs.forEach((fun) => {\r\n typeof fun === \"function\" && fun();\r\n });\r\n\r\n control.value && control.value.update();\r\n renderer.render(scene, camera);\r\n stats && stats.update();\r\n css3dRenderer && css3dRenderer.render(scene, camera);\r\n\r\n requestAnimationFrame(animate);\r\n }\r\n\r\n function onResize() {\r\n nextTick(() => {\r\n const size = getTargetSize();\r\n domWidth.value = size[0];\r\n domHeight.value = size[1];\r\n camera.aspect = domWidth.value / domHeight.value;\r\n // adjust the FOV\r\n camera.fov =\r\n (360 / Math.PI) *\r\n Math.atan(tanFOV * (domHeight.value / domWidth.value));\r\n camera.updateProjectionMatrix();\r\n camera.lookAt(scene.position);\r\n\r\n renderer.render(scene, camera);\r\n renderer.setSize(domWidth.value, domHeight.value);\r\n\r\n css3dRenderer && css3dRenderer.setSize(domWidth.value, domHeight.value);\r\n });\r\n }\r\n\r\n function getTargetSize() {\r\n el = document.querySelector(selector);\r\n return [el.clientWidth, el.clientHeight];\r\n }\r\n\r\n function initStats() {\r\n stats = new Stats();\r\n stats.dom.style.cssText =\r\n \"position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000\";\r\n el.appendChild(stats.dom);\r\n }\r\n\r\n /**物体视窗自动适应\r\n *\r\n * @param {Object3D} model\r\n * @param {Number} scale\r\n * @param {Camera} camera\r\n * @param {OrbitControls} controls\r\n * @param {Vector3} offset\r\n */\r\n function frameArea(model, scale, camera, controls, offset) {\r\n const box = new Box3().setFromObject(model);\r\n const boxSize = box.getSize(new Vector3()).length();\r\n const boxCenter = box.getCenter(new Vector3());\r\n\r\n if (offset) boxCenter.add(offset);\r\n\r\n const sizeToFitOnScreen = boxSize * scale;\r\n const halfSizeToFitOnScreen = sizeToFitOnScreen * 0.5;\r\n const halfFovY = MathUtils.degToRad(camera.fov * 0.5);\r\n const distance = halfSizeToFitOnScreen / Math.tan(halfFovY);\r\n const direction = new Vector3()\r\n .subVectors(camera.position, boxCenter)\r\n .multiply(new Vector3(1, 1, 1))\r\n .normalize();\r\n\r\n const neP = direction.multiplyScalar(distance).add(boxCenter);\r\n const targetOption = {\r\n x: neP.x,\r\n y: neP.y,\r\n z: neP.z,\r\n lookAt_x: boxCenter.x,\r\n lookAt_y: boxCenter.y,\r\n lookAt_z: boxCenter.z,\r\n };\r\n\r\n camera.position.set(targetOption.x, targetOption.y, targetOption.z);\r\n camera.lookAt(\r\n targetOption.lookAt_x,\r\n targetOption.lookAt_y,\r\n targetOption.lookAt_z\r\n );\r\n camera.updateProjectionMatrix();\r\n controls.target.copy(boxCenter);\r\n controls.update();\r\n return boxSize;\r\n }\r\n\r\n function createCss3dRenderer() {\r\n css3dRenderer = new CSS3DRenderer();\r\n css3dRenderer.setSize(domWidth.value, domHeight.value);\r\n css3dRenderer.domElement.style.position = \"absolute\";\r\n css3dRenderer.domElement.style.top = 0;\r\n css3dRenderer.domElement.style.left = 0;\r\n css3dRenderer.domElement.style.pointerEvents = \"none\";\r\n el.appendChild(css3dRenderer.domElement);\r\n }\r\n\r\n function dispose() {\r\n disposeThreeObject(scene);\r\n }\r\n\r\n onMounted(() => {\r\n control.value = init();\r\n\r\n renderer.domElement.addEventListener(\"resize\", onResize, false);\r\n renderer.domElement.addEventListener(\r\n \"webglcontextlost\",\r\n onContextLost,\r\n false\r\n );\r\n renderer.domElement.addEventListener(\r\n \"webglcontextrestored\",\r\n onContextRestored,\r\n false\r\n );\r\n requestAnimationFrame(animate);\r\n });\r\n\r\n onUnmounted(() => {\r\n cancelAnimationFrame(animate);\r\n renderer.domElement.removeEventListener(\"resize\", onResize, false);\r\n renderer.domElement.removeEventListener(\r\n \"webglcontextlost\",\r\n onContextLost,\r\n false\r\n );\r\n renderer.domElement.removeEventListener(\r\n \"webglcontextrestored\",\r\n onContextRestored,\r\n false\r\n );\r\n dispose();\r\n });\r\n\r\n return {\r\n addAnimate,\r\n frameArea,\r\n\r\n scene,\r\n camera,\r\n control,\r\n renderer,\r\n domWidth,\r\n domHeight,\r\n isReady,\r\n };\r\n}\r\n",
774
- "static": true,
775
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/useThreeJs.js",
776
- "access": "public",
777
- "description": null,
778
- "lineNumber": 1
779
- },
780
- {
781
- "__docId__": 58,
782
- "kind": "variable",
783
- "name": "defaultControlOpt",
784
- "memberof": "src/hooks/useThreeJs.js",
785
- "static": true,
786
- "longname": "src/hooks/useThreeJs.js~defaultControlOpt",
787
- "access": "public",
788
- "export": false,
789
- "importPath": "@ridp/threejs/src/hooks/useThreeJs.js",
790
- "importStyle": null,
791
- "description": null,
792
- "lineNumber": 20,
793
- "undocument": true,
794
- "type": {
795
- "types": [
796
- "{\"enableDamping\": boolean, \"dampingFactor\": number, \"screenSpacePanning\": *, \"minDistance\": number, \"maxDistance\": number, \"maxPolarAngle\": *}"
797
- ]
798
- },
799
- "ignore": true
800
- },
801
- {
802
- "__docId__": 59,
803
- "kind": "function",
804
- "name": "useThreeJs",
805
- "memberof": "src/hooks/useThreeJs.js",
806
- "generator": false,
807
- "async": false,
808
- "static": true,
809
- "longname": "src/hooks/useThreeJs.js~useThreeJs",
810
- "access": "public",
811
- "export": true,
812
- "importPath": "@ridp/threejs/src/hooks/useThreeJs.js",
813
- "importStyle": "{useThreeJs}",
814
- "description": "",
815
- "lineNumber": 44,
816
- "unknown": [
817
- {
818
- "tagName": "@returns",
819
- "tagValue": "any"
820
- }
821
- ],
822
- "params": [
823
- {
824
- "nullable": null,
825
- "types": [
826
- "String"
827
- ],
828
- "spread": false,
829
- "optional": false,
830
- "name": "selector",
831
- "description": "ID '#xxxx'"
832
- },
833
- {
834
- "nullable": null,
835
- "types": [
836
- "Object"
837
- ],
838
- "spread": false,
839
- "optional": false,
840
- "name": "option",
841
- "description": "{\n css3d: false,\nstats: false,\ncontrol: {\ninit: true,\noptions: {\n...OrbitControls属性\n},\n},\n}"
842
- }
843
- ],
844
- "return": {
845
- "nullable": null,
846
- "types": [
847
- "*"
848
- ],
849
- "spread": false,
850
- "description": "any"
851
- }
852
- },
853
- {
854
- "__docId__": 60,
855
- "kind": "file",
856
- "name": "src/index.js",
857
- "content": "export * from \"./hooks\";\r\nexport * from \"./utils\";\r\nexport * from \"./instance\";\r\n",
858
- "static": true,
859
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/index.js",
860
- "access": "public",
861
- "description": null,
862
- "lineNumber": 1
863
- },
864
- {
865
- "__docId__": 61,
866
- "kind": "file",
867
- "name": "src/instance/IDBCache.js",
868
- "content": "import * as THREE from \"three\";\r\nimport Dexie from \"dexie\";\r\n\r\n/**\r\n * ThreeJS 缓存工具类\r\n */\r\nexport class IDBCache {\r\n /**\r\n * 构造函数\r\n * @param {string} dbName - 数据库名称\r\n * @param {Object} tableDefinitions - 表定义对象,例如 { models: \"&path, data\" }\r\n * @param {number} version - 数据库版本号\r\n */\r\n constructor(dbName = \"threeJsIDBCache\", version = 1) {\r\n this.db = new Dexie(dbName);\r\n this.materialMap = {};\r\n\r\n // 初始化数据库版本和表\r\n this.db.version(version).stores({ models: \"&path, data\" });\r\n }\r\n\r\n /**\r\n * 获取 Dexie 数据库实例\r\n * @returns {Dexie} Dexie 实例\r\n */\r\n getDatabase() {\r\n return this.db;\r\n }\r\n\r\n /**\r\n * 序列化 Three.js 对象\r\n * @param {THREE.Object3D} object - 要序列化的对象\r\n * @returns {Object} 序列化后的数据\r\n */\r\n serObject3D(object) {\r\n const serialized = {\r\n type: object.type,\r\n name: object.name,\r\n position: object.position.toArray(),\r\n rotation: object.rotation.toArray(),\r\n scale: object.scale.toArray(),\r\n visible: object.visible,\r\n children: [],\r\n geometry: null,\r\n material: null,\r\n };\r\n\r\n if (object.isMesh) {\r\n serialized.geometry = this.serGeometry(object.geometry);\r\n serialized.material = this.serMaterial(object.material);\r\n }\r\n\r\n for (const child of object.children) {\r\n serialized.children.push(this.serObject3D(child));\r\n }\r\n\r\n return serialized;\r\n }\r\n\r\n /**\r\n * 序列化几何体\r\n * @param {THREE.BufferGeometry} geometry - 几何体\r\n * @returns {Object} 序列化后的几何体数据\r\n */\r\n serGeometry(geometry) {\r\n const _attributes = [];\r\n const { attributes, index, type } = geometry;\r\n\r\n if (attributes.position)\r\n _attributes[\"position\"] = {\r\n type: \"Float32Array\",\r\n array: Array.from(attributes.position.array),\r\n itemSize: 3,\r\n };\r\n if (attributes.normal)\r\n _attributes[\"normal\"] = {\r\n type: \"Float32Array\",\r\n array: Array.from(attributes.normal.array),\r\n itemSize: 3,\r\n };\r\n if (attributes.uv)\r\n _attributes[\"uv\"] = {\r\n type: \"Float32Array\",\r\n array: Array.from(attributes.uv.array),\r\n itemSize: 2,\r\n };\r\n\r\n const result = {\r\n type: type,\r\n attributes: _attributes,\r\n };\r\n\r\n if (index && index.array) {\r\n result[\"index\"] = {\r\n type: \"Uint32Array\",\r\n array: Array.from(index.array),\r\n itemSize: 1,\r\n };\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * 反序列化几何体\r\n * @param {Object} data - 序列化后的几何体数据\r\n * @returns {THREE.BufferGeometry} 反序列化后的几何体\r\n */\r\n reSerGeometry(data) {\r\n const { type, attributes, index } = data;\r\n const geometry = new THREE.BufferGeometry();\r\n Object.keys(attributes).forEach((key) => {\r\n const { type, array, itemSize } = attributes[key];\r\n geometry.setAttribute(\r\n key,\r\n new THREE.BufferAttribute(new Float32Array(array), itemSize)\r\n );\r\n });\r\n\r\n if (index) {\r\n geometry.setIndex(index.array);\r\n }\r\n return geometry;\r\n }\r\n\r\n /**\r\n * 序列化材质\r\n * @param {THREE.Material} material - 材质\r\n * @returns {Object} 序列化后的材质数据\r\n */\r\n serMaterial(material) {\r\n return {\r\n type: material.type,\r\n color: material.color.getHex(),\r\n map: material.map ? material.map.image.src : null,\r\n opacity: material.opacity,\r\n name: material.name,\r\n depthTest: material.depthTest,\r\n depthWrite: material.depthWrite,\r\n transparent: material.transparent,\r\n side: material.side,\r\n roughness: material.roughness,\r\n metalness: material.metalness,\r\n emissive: material.emissive.getHex(),\r\n };\r\n }\r\n\r\n /**\r\n * 反序列化材质\r\n * @param {Object} data - 序列化后的材质数据\r\n * @returns {THREE.Material} 反序列化后的材质\r\n */\r\n reSerMaterial(data) {\r\n // 同名材质复用\r\n if (this.materialMap[data.name]) return this.materialMap[data.name];\r\n const { type, ...rest } = data;\r\n\r\n const materialType = type || \"MeshStandardMaterial\";\r\n const material = new THREE[materialType]({ ...rest });\r\n if (data.map) {\r\n const texture = new THREE.TextureLoader().load(data.map);\r\n material.map = texture;\r\n }\r\n material.needsUpdate = true;\r\n\r\n this.materialMap[data.name] = material;\r\n return material;\r\n }\r\n\r\n /**\r\n * 反序列化 Three.js 对象\r\n * @param {Object} data - 序列化后的数据\r\n * @returns {THREE.Object3D} 反序列化后的对象\r\n */\r\n reSerObject3D(data) {\r\n let object;\r\n\r\n switch (data.type) {\r\n case \"Mesh\":\r\n const geometry = this.reSerGeometry(data.geometry);\r\n const material = this.reSerMaterial(data.material);\r\n object = new THREE.Mesh(geometry, material);\r\n break;\r\n case \"Group\":\r\n object = new THREE.Group();\r\n break;\r\n case \"Object3D\":\r\n object = new THREE.Object3D();\r\n break;\r\n default:\r\n console.warn(`Unsupported object type: ${data.type}`);\r\n return null;\r\n }\r\n\r\n object.name = data.name;\r\n object.position.fromArray(data.position);\r\n object.rotation.fromArray(data.rotation);\r\n object.scale.fromArray(data.scale);\r\n object.visible = data.visible;\r\n\r\n for (const childData of data.children) {\r\n const child = this.reSerObject3D(childData);\r\n if (child) {\r\n object.add(child);\r\n }\r\n }\r\n\r\n return object;\r\n }\r\n\r\n /**\r\n * 缓存模型到 IndexedDB\r\n * @param {string} path - 主键值\r\n * @param {THREE.Object3D} model - 要缓存的模型\r\n */\r\n async cacheModel(path, model) {\r\n const serializedData = this.serObject3D(model);\r\n await this.db.table(\"models\").put({ path, data: serializedData });\r\n console.log(`Model \"${path}\" cached successfully in table models`);\r\n }\r\n\r\n /**\r\n * 从 IndexedDB 加载缓存的模型\r\n * @param {string} path - 主键值\r\n * @returns {THREE.Object3D | null} 加载的模型\r\n */\r\n async loadCachedModel(path) {\r\n const record = await this.db.table(\"models\").get(path);\r\n if (!record) {\r\n console.warn(`Model \"${path}\" not found in table models`);\r\n return null;\r\n }\r\n const deserializedModel = this.reSerObject3D(record.data);\r\n console.log(`Model \"${path}\" loaded from table models`);\r\n return deserializedModel;\r\n }\r\n}\r\n",
869
- "static": true,
870
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/instance/IDBCache.js",
871
- "access": "public",
872
- "description": null,
873
- "lineNumber": 1
874
- },
875
- {
876
- "__docId__": 62,
877
- "kind": "class",
878
- "name": "IDBCache",
879
- "memberof": "src/instance/IDBCache.js",
880
- "static": true,
881
- "longname": "src/instance/IDBCache.js~IDBCache",
882
- "access": "public",
883
- "export": true,
884
- "importPath": "@ridp/threejs/src/instance/IDBCache.js",
885
- "importStyle": "{IDBCache}",
886
- "description": "ThreeJS 缓存工具类",
887
- "lineNumber": 7,
888
- "interface": false
889
- },
890
- {
891
- "__docId__": 63,
892
- "kind": "constructor",
893
- "name": "constructor",
894
- "memberof": "src/instance/IDBCache.js~IDBCache",
895
- "generator": false,
896
- "async": false,
897
- "static": false,
898
- "longname": "src/instance/IDBCache.js~IDBCache#constructor",
899
- "access": "public",
900
- "description": "构造函数",
901
- "lineNumber": 14,
902
- "params": [
903
- {
904
- "nullable": null,
905
- "types": [
906
- "string"
907
- ],
908
- "spread": false,
909
- "optional": false,
910
- "name": "dbName",
911
- "description": "数据库名称"
912
- },
913
- {
914
- "nullable": null,
915
- "types": [
916
- "Object"
917
- ],
918
- "spread": false,
919
- "optional": false,
920
- "name": "tableDefinitions",
921
- "description": "表定义对象,例如 { models: \"&path, data\" }"
922
- },
923
- {
924
- "nullable": null,
925
- "types": [
926
- "number"
927
- ],
928
- "spread": false,
929
- "optional": false,
930
- "name": "version",
931
- "description": "数据库版本号"
932
- }
933
- ]
934
- },
935
- {
936
- "__docId__": 64,
937
- "kind": "member",
938
- "name": "db",
939
- "memberof": "src/instance/IDBCache.js~IDBCache",
940
- "static": false,
941
- "longname": "src/instance/IDBCache.js~IDBCache#db",
942
- "access": "public",
943
- "description": null,
944
- "lineNumber": 15,
945
- "undocument": true,
946
- "type": {
947
- "types": [
948
- "*"
949
- ]
950
- }
951
- },
952
- {
953
- "__docId__": 65,
954
- "kind": "member",
955
- "name": "materialMap",
956
- "memberof": "src/instance/IDBCache.js~IDBCache",
957
- "static": false,
958
- "longname": "src/instance/IDBCache.js~IDBCache#materialMap",
959
- "access": "public",
960
- "description": null,
961
- "lineNumber": 16,
962
- "undocument": true,
963
- "type": {
964
- "types": [
965
- "{}"
966
- ]
967
- }
968
- },
969
- {
970
- "__docId__": 66,
971
- "kind": "method",
972
- "name": "getDatabase",
973
- "memberof": "src/instance/IDBCache.js~IDBCache",
974
- "generator": false,
975
- "async": false,
976
- "static": false,
977
- "longname": "src/instance/IDBCache.js~IDBCache#getDatabase",
978
- "access": "public",
979
- "description": "获取 Dexie 数据库实例",
980
- "lineNumber": 26,
981
- "unknown": [
982
- {
983
- "tagName": "@returns",
984
- "tagValue": "{Dexie} Dexie 实例"
985
- }
986
- ],
987
- "return": {
988
- "nullable": null,
989
- "types": [
990
- "Dexie"
991
- ],
992
- "spread": false,
993
- "description": "Dexie 实例"
994
- },
995
- "params": []
996
- },
997
- {
998
- "__docId__": 67,
999
- "kind": "method",
1000
- "name": "serObject3D",
1001
- "memberof": "src/instance/IDBCache.js~IDBCache",
1002
- "generator": false,
1003
- "async": false,
1004
- "static": false,
1005
- "longname": "src/instance/IDBCache.js~IDBCache#serObject3D",
1006
- "access": "public",
1007
- "description": "序列化 Three.js 对象",
1008
- "lineNumber": 35,
1009
- "unknown": [
1010
- {
1011
- "tagName": "@returns",
1012
- "tagValue": "{Object} 序列化后的数据"
1013
- }
1014
- ],
1015
- "params": [
1016
- {
1017
- "nullable": null,
1018
- "types": [
1019
- "THREE.Object3D"
1020
- ],
1021
- "spread": false,
1022
- "optional": false,
1023
- "name": "object",
1024
- "description": "要序列化的对象"
1025
- }
1026
- ],
1027
- "return": {
1028
- "nullable": null,
1029
- "types": [
1030
- "Object"
1031
- ],
1032
- "spread": false,
1033
- "description": "序列化后的数据"
1034
- }
1035
- },
1036
- {
1037
- "__docId__": 68,
1038
- "kind": "method",
1039
- "name": "serGeometry",
1040
- "memberof": "src/instance/IDBCache.js~IDBCache",
1041
- "generator": false,
1042
- "async": false,
1043
- "static": false,
1044
- "longname": "src/instance/IDBCache.js~IDBCache#serGeometry",
1045
- "access": "public",
1046
- "description": "序列化几何体",
1047
- "lineNumber": 65,
1048
- "unknown": [
1049
- {
1050
- "tagName": "@returns",
1051
- "tagValue": "{Object} 序列化后的几何体数据"
1052
- }
1053
- ],
1054
- "params": [
1055
- {
1056
- "nullable": null,
1057
- "types": [
1058
- "THREE.BufferGeometry"
1059
- ],
1060
- "spread": false,
1061
- "optional": false,
1062
- "name": "geometry",
1063
- "description": "几何体"
1064
- }
1065
- ],
1066
- "return": {
1067
- "nullable": null,
1068
- "types": [
1069
- "Object"
1070
- ],
1071
- "spread": false,
1072
- "description": "序列化后的几何体数据"
1073
- }
1074
- },
1075
- {
1076
- "__docId__": 69,
1077
- "kind": "method",
1078
- "name": "reSerGeometry",
1079
- "memberof": "src/instance/IDBCache.js~IDBCache",
1080
- "generator": false,
1081
- "async": false,
1082
- "static": false,
1083
- "longname": "src/instance/IDBCache.js~IDBCache#reSerGeometry",
1084
- "access": "public",
1085
- "description": "反序列化几何体",
1086
- "lineNumber": 109,
1087
- "unknown": [
1088
- {
1089
- "tagName": "@returns",
1090
- "tagValue": "{THREE.BufferGeometry} 反序列化后的几何体"
1091
- }
1092
- ],
1093
- "params": [
1094
- {
1095
- "nullable": null,
1096
- "types": [
1097
- "Object"
1098
- ],
1099
- "spread": false,
1100
- "optional": false,
1101
- "name": "data",
1102
- "description": "序列化后的几何体数据"
1103
- }
1104
- ],
1105
- "return": {
1106
- "nullable": null,
1107
- "types": [
1108
- "THREE.BufferGeometry"
1109
- ],
1110
- "spread": false,
1111
- "description": "反序列化后的几何体"
1112
- }
1113
- },
1114
- {
1115
- "__docId__": 70,
1116
- "kind": "method",
1117
- "name": "serMaterial",
1118
- "memberof": "src/instance/IDBCache.js~IDBCache",
1119
- "generator": false,
1120
- "async": false,
1121
- "static": false,
1122
- "longname": "src/instance/IDBCache.js~IDBCache#serMaterial",
1123
- "access": "public",
1124
- "description": "序列化材质",
1125
- "lineNumber": 131,
1126
- "unknown": [
1127
- {
1128
- "tagName": "@returns",
1129
- "tagValue": "{Object} 序列化后的材质数据"
1130
- }
1131
- ],
1132
- "params": [
1133
- {
1134
- "nullable": null,
1135
- "types": [
1136
- "THREE.Material"
1137
- ],
1138
- "spread": false,
1139
- "optional": false,
1140
- "name": "material",
1141
- "description": "材质"
1142
- }
1143
- ],
1144
- "return": {
1145
- "nullable": null,
1146
- "types": [
1147
- "Object"
1148
- ],
1149
- "spread": false,
1150
- "description": "序列化后的材质数据"
1151
- }
1152
- },
1153
- {
1154
- "__docId__": 71,
1155
- "kind": "method",
1156
- "name": "reSerMaterial",
1157
- "memberof": "src/instance/IDBCache.js~IDBCache",
1158
- "generator": false,
1159
- "async": false,
1160
- "static": false,
1161
- "longname": "src/instance/IDBCache.js~IDBCache#reSerMaterial",
1162
- "access": "public",
1163
- "description": "反序列化材质",
1164
- "lineNumber": 153,
1165
- "unknown": [
1166
- {
1167
- "tagName": "@returns",
1168
- "tagValue": "{THREE.Material} 反序列化后的材质"
1169
- }
1170
- ],
1171
- "params": [
1172
- {
1173
- "nullable": null,
1174
- "types": [
1175
- "Object"
1176
- ],
1177
- "spread": false,
1178
- "optional": false,
1179
- "name": "data",
1180
- "description": "序列化后的材质数据"
1181
- }
1182
- ],
1183
- "return": {
1184
- "nullable": null,
1185
- "types": [
1186
- "THREE.Material"
1187
- ],
1188
- "spread": false,
1189
- "description": "反序列化后的材质"
1190
- }
1191
- },
1192
- {
1193
- "__docId__": 72,
1194
- "kind": "method",
1195
- "name": "reSerObject3D",
1196
- "memberof": "src/instance/IDBCache.js~IDBCache",
1197
- "generator": false,
1198
- "async": false,
1199
- "static": false,
1200
- "longname": "src/instance/IDBCache.js~IDBCache#reSerObject3D",
1201
- "access": "public",
1202
- "description": "反序列化 Three.js 对象",
1203
- "lineNumber": 175,
1204
- "unknown": [
1205
- {
1206
- "tagName": "@returns",
1207
- "tagValue": "{THREE.Object3D} 反序列化后的对象"
1208
- }
1209
- ],
1210
- "params": [
1211
- {
1212
- "nullable": null,
1213
- "types": [
1214
- "Object"
1215
- ],
1216
- "spread": false,
1217
- "optional": false,
1218
- "name": "data",
1219
- "description": "序列化后的数据"
1220
- }
1221
- ],
1222
- "return": {
1223
- "nullable": null,
1224
- "types": [
1225
- "THREE.Object3D"
1226
- ],
1227
- "spread": false,
1228
- "description": "反序列化后的对象"
1229
- }
1230
- },
1231
- {
1232
- "__docId__": 73,
1233
- "kind": "method",
1234
- "name": "cacheModel",
1235
- "memberof": "src/instance/IDBCache.js~IDBCache",
1236
- "generator": false,
1237
- "async": true,
1238
- "static": false,
1239
- "longname": "src/instance/IDBCache.js~IDBCache#cacheModel",
1240
- "access": "public",
1241
- "description": "缓存模型到 IndexedDB",
1242
- "lineNumber": 216,
1243
- "params": [
1244
- {
1245
- "nullable": null,
1246
- "types": [
1247
- "string"
1248
- ],
1249
- "spread": false,
1250
- "optional": false,
1251
- "name": "path",
1252
- "description": "主键值"
1253
- },
1254
- {
1255
- "nullable": null,
1256
- "types": [
1257
- "THREE.Object3D"
1258
- ],
1259
- "spread": false,
1260
- "optional": false,
1261
- "name": "model",
1262
- "description": "要缓存的模型"
1263
- }
1264
- ],
1265
- "return": null
1266
- },
1267
- {
1268
- "__docId__": 74,
1269
- "kind": "method",
1270
- "name": "loadCachedModel",
1271
- "memberof": "src/instance/IDBCache.js~IDBCache",
1272
- "generator": false,
1273
- "async": true,
1274
- "static": false,
1275
- "longname": "src/instance/IDBCache.js~IDBCache#loadCachedModel",
1276
- "access": "public",
1277
- "description": "从 IndexedDB 加载缓存的模型",
1278
- "lineNumber": 227,
1279
- "unknown": [
1280
- {
1281
- "tagName": "@returns",
1282
- "tagValue": "{THREE.Object3D | null} 加载的模型"
1283
- }
1284
- ],
1285
- "params": [
1286
- {
1287
- "nullable": null,
1288
- "types": [
1289
- "string"
1290
- ],
1291
- "spread": false,
1292
- "optional": false,
1293
- "name": "path",
1294
- "description": "主键值"
1295
- }
1296
- ],
1297
- "return": {
1298
- "nullable": null,
1299
- "types": [
1300
- "THREE.Object3D ",
1301
- " null"
1302
- ],
1303
- "spread": false,
1304
- "description": "加载的模型"
1305
- }
1306
- },
1307
- {
1308
- "__docId__": 75,
1309
- "kind": "file",
1310
- "name": "src/instance/index.js",
1311
- "content": "export * from \"./IDBCache\";\r\n",
1312
- "static": true,
1313
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/instance/index.js",
1314
- "access": "public",
1315
- "description": null,
1316
- "lineNumber": 1
1317
- },
1318
- {
1319
- "__docId__": 76,
1320
- "kind": "file",
1321
- "name": "src/utils/common.js",
1322
- "content": "export const getCommonParent = (meshList, objectGroup) => {\r\n const parentCount = {};\r\n\r\n meshList.forEach((mesh) => {\r\n let parent = mesh.parent;\r\n while (parent) {\r\n if (parentCount[parent.uuid]) {\r\n parentCount[parent.uuid]++;\r\n } else {\r\n parentCount[parent.uuid] = 1;\r\n }\r\n parent = parent.parent;\r\n }\r\n });\r\n\r\n let commonParent = null;\r\n let maxCount = 0;\r\n\r\n for (const uuid in parentCount) {\r\n if (parentCount[uuid] > maxCount) {\r\n maxCount = parentCount[uuid];\r\n commonParent = objectGroup.getObjectByProperty(\"uuid\", uuid);\r\n }\r\n }\r\n\r\n return commonParent;\r\n};\r\n",
1323
- "static": true,
1324
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/common.js",
1325
- "access": "public",
1326
- "description": null,
1327
- "lineNumber": 1
1328
- },
1329
- {
1330
- "__docId__": 77,
1331
- "kind": "function",
1332
- "name": "getCommonParent",
1333
- "memberof": "src/utils/common.js",
1334
- "generator": false,
1335
- "async": false,
1336
- "static": true,
1337
- "longname": "src/utils/common.js~getCommonParent",
1338
- "access": "public",
1339
- "export": true,
1340
- "importPath": "@ridp/threejs/src/utils/common.js",
1341
- "importStyle": "{getCommonParent}",
1342
- "description": null,
1343
- "lineNumber": 1,
1344
- "undocument": true,
1345
- "params": [
1346
- {
1347
- "name": "meshList",
1348
- "types": [
1349
- "*"
1350
- ]
1351
- },
1352
- {
1353
- "name": "objectGroup",
1354
- "types": [
1355
- "*"
1356
- ]
1357
- }
1358
- ],
1359
- "return": {
1360
- "types": [
1361
- "*"
1362
- ]
1363
- }
1364
- },
1365
- {
1366
- "__docId__": 78,
1367
- "kind": "file",
1368
- "name": "src/utils/css3dHelper.js",
1369
- "content": "import { CSS3DSprite } from \"three/examples/jsm/Addons.js\";\r\n\r\n/**\r\n * 创建 CSS3DSprite 信息面板\r\n * @param { string } id 元素ID\r\n * @param { [ number, number, number ]} scale 缩放\r\n * @returns new CSS3DSprite()\r\n *\r\n * 注意: html元素不能设置模板为结对定位!!!\r\n */\r\nexport function createInfoPlane(id, scale = [0.3, 0.3, 0.3]) {\r\n const el = document.querySelector(`#${id}`);\r\n if (!el) {\r\n console.log(\" 获取 infoPlane 元素失败 (id) =====> :\", id);\r\n return;\r\n }\r\n const _el = el.cloneNode(true);\r\n _el.style.display = \"block\";\r\n\r\n const plane = new CSS3DSprite(_el);\r\n plane.visible = false;\r\n plane.scale.set(...scale);\r\n return plane;\r\n}\r\nexport function createTagPlane(text, scale) {\r\n const el = tagBlock(text);\r\n el.style.display = \"block\";\r\n const plane = new CSS3DSprite(el);\r\n plane.visible = false;\r\n plane.scale.set(scale, scale, scale);\r\n return plane;\r\n}\r\n\r\nconst tagBlock = (text) => {\r\n const el = document.createElement(\"div\");\r\n el.style.cssText = `\r\n border-radius: 50px;\r\n border: 2px solid rgba(255, 255, 255, 0.5);\r\n background-color: rgba(15, 20, 22, 0.562);\r\n justify-content: flex-start;\r\n align-items: center;\r\n padding: 20px 30px;\r\n display: flex;\r\n transform-origin: center 0;`;\r\n const textSpan = document.createElement(\"span\");\r\n textSpan.style.cssText = `\r\n font-size: 40px;\r\n line-height: 1;\r\n white-space: nowrap;\r\n color: #fff;\r\n font-weight: 700;\r\n `;\r\n textSpan.innerText = text;\r\n el.appendChild(textSpan);\r\n return el;\r\n};\r\n",
1370
- "static": true,
1371
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/css3dHelper.js",
1372
- "access": "public",
1373
- "description": null,
1374
- "lineNumber": 1
1375
- },
1376
- {
1377
- "__docId__": 79,
1378
- "kind": "function",
1379
- "name": "createInfoPlane",
1380
- "memberof": "src/utils/css3dHelper.js",
1381
- "generator": false,
1382
- "async": false,
1383
- "static": true,
1384
- "longname": "src/utils/css3dHelper.js~createInfoPlane",
1385
- "access": "public",
1386
- "export": true,
1387
- "importPath": "@ridp/threejs/src/utils/css3dHelper.js",
1388
- "importStyle": "{createInfoPlane}",
1389
- "description": "创建 CSS3DSprite 信息面板",
1390
- "lineNumber": 11,
1391
- "unknown": [
1392
- {
1393
- "tagName": "@returns",
1394
- "tagValue": "new CSS3DSprite()\n\n注意: html元素不能设置模板为结对定位!!!"
1395
- }
1396
- ],
1397
- "params": [
1398
- {
1399
- "nullable": null,
1400
- "types": [
1401
- " string "
1402
- ],
1403
- "spread": false,
1404
- "optional": false,
1405
- "name": "id",
1406
- "description": "元素ID"
1407
- },
1408
- {
1409
- "nullable": null,
1410
- "types": [
1411
- " [ number, number, number ]"
1412
- ],
1413
- "spread": false,
1414
- "optional": false,
1415
- "name": "scale",
1416
- "description": "缩放"
1417
- }
1418
- ],
1419
- "return": {
1420
- "nullable": null,
1421
- "types": [
1422
- "*"
1423
- ],
1424
- "spread": false,
1425
- "description": "new CSS3DSprite()\n\n注意: html元素不能设置模板为结对定位!!!"
1426
- }
1427
- },
1428
- {
1429
- "__docId__": 80,
1430
- "kind": "function",
1431
- "name": "createTagPlane",
1432
- "memberof": "src/utils/css3dHelper.js",
1433
- "generator": false,
1434
- "async": false,
1435
- "static": true,
1436
- "longname": "src/utils/css3dHelper.js~createTagPlane",
1437
- "access": "public",
1438
- "export": true,
1439
- "importPath": "@ridp/threejs/src/utils/css3dHelper.js",
1440
- "importStyle": "{createTagPlane}",
1441
- "description": null,
1442
- "lineNumber": 25,
1443
- "undocument": true,
1444
- "params": [
1445
- {
1446
- "name": "text",
1447
- "types": [
1448
- "*"
1449
- ]
1450
- },
1451
- {
1452
- "name": "scale",
1453
- "types": [
1454
- "*"
1455
- ]
1456
- }
1457
- ],
1458
- "return": {
1459
- "types": [
1460
- "*"
1461
- ]
1462
- }
1463
- },
1464
- {
1465
- "__docId__": 81,
1466
- "kind": "function",
1467
- "name": "tagBlock",
1468
- "memberof": "src/utils/css3dHelper.js",
1469
- "generator": false,
1470
- "async": false,
1471
- "static": true,
1472
- "longname": "src/utils/css3dHelper.js~tagBlock",
1473
- "access": "public",
1474
- "export": false,
1475
- "importPath": "@ridp/threejs/src/utils/css3dHelper.js",
1476
- "importStyle": null,
1477
- "description": null,
1478
- "lineNumber": 34,
1479
- "undocument": true,
1480
- "params": [
1481
- {
1482
- "name": "text",
1483
- "types": [
1484
- "*"
1485
- ]
1486
- }
1487
- ],
1488
- "return": {
1489
- "types": [
1490
- "*"
1491
- ]
1492
- },
1493
- "ignore": true
1494
- },
1495
- {
1496
- "__docId__": 82,
1497
- "kind": "file",
1498
- "name": "src/utils/disposeObject.js",
1499
- "content": "/**\r\n * 递归释放THREE.js对象 / 材质\r\n * @param { Object3D } object\r\n */\r\nexport const disposeThreeObject = (object) => {\r\n if (object.geometry) {\r\n object.geometry.dispose();\r\n }\r\n\r\n if (object.material) {\r\n // 如果材质是一个数组(例如多材质对象),需要遍历数组并释放每个材质\r\n if (Array.isArray(object.material)) {\r\n object.material.forEach((material) => {\r\n disposeMaterial(material);\r\n });\r\n } else {\r\n disposeMaterial(object.material);\r\n }\r\n }\r\n\r\n // 递归释放子对象\r\n if (object.children) {\r\n object.children.forEach((child) => disposeThreeObject(child));\r\n }\r\n};\r\n\r\n/**\r\n * 释放THREE.js材质\r\n * @param { Material } material\r\n */\r\nfunction disposeMaterial(material) {\r\n // 释放材质的纹理\r\n for (const key in material) {\r\n if (material[key] && material[key].isTexture) {\r\n material[key].dispose();\r\n }\r\n }\r\n material.dispose();\r\n}\r\n",
1500
- "static": true,
1501
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/disposeObject.js",
1502
- "access": "public",
1503
- "description": null,
1504
- "lineNumber": 1
1505
- },
1506
- {
1507
- "__docId__": 83,
1508
- "kind": "function",
1509
- "name": "disposeThreeObject",
1510
- "memberof": "src/utils/disposeObject.js",
1511
- "generator": false,
1512
- "async": false,
1513
- "static": true,
1514
- "longname": "src/utils/disposeObject.js~disposeThreeObject",
1515
- "access": "public",
1516
- "export": true,
1517
- "importPath": "@ridp/threejs/src/utils/disposeObject.js",
1518
- "importStyle": "{disposeThreeObject}",
1519
- "description": "递归释放THREE.js对象 / 材质",
1520
- "lineNumber": 5,
1521
- "params": [
1522
- {
1523
- "nullable": null,
1524
- "types": [
1525
- " Object3D "
1526
- ],
1527
- "spread": false,
1528
- "optional": false,
1529
- "name": "object",
1530
- "description": ""
1531
- }
1532
- ],
1533
- "return": null
1534
- },
1535
- {
1536
- "__docId__": 84,
1537
- "kind": "function",
1538
- "name": "disposeMaterial",
1539
- "memberof": "src/utils/disposeObject.js",
1540
- "generator": false,
1541
- "async": false,
1542
- "static": true,
1543
- "longname": "src/utils/disposeObject.js~disposeMaterial",
1544
- "access": "public",
1545
- "export": false,
1546
- "importPath": "@ridp/threejs/src/utils/disposeObject.js",
1547
- "importStyle": null,
1548
- "description": "释放THREE.js材质",
1549
- "lineNumber": 31,
1550
- "params": [
1551
- {
1552
- "nullable": null,
1553
- "types": [
1554
- " Material "
1555
- ],
1556
- "spread": false,
1557
- "optional": false,
1558
- "name": "material",
1559
- "description": ""
1560
- }
1561
- ],
1562
- "return": null,
1563
- "ignore": true
1564
- },
1565
- {
1566
- "__docId__": 85,
1567
- "kind": "file",
1568
- "name": "src/utils/helper.js",
1569
- "content": "import {\r\n BoxHelper,\r\n GridHelper,\r\n Raycaster,\r\n Vector2,\r\n AxesHelper,\r\n Vector3,\r\n ArrowHelper,\r\n CameraHelper,\r\n} from \"three\";\r\nimport { OrbitControls } from \"three/addons/controls/OrbitControls.js\";\r\nimport { MapControls } from \"three/addons/controls/MapControls.js\";\r\nimport Stats from \"three/addons/libs/stats.module.js\";\r\n\r\nexport function createCameraHelper(camera) {\r\n return new CameraHelper(camera);\r\n}\r\n\r\nexport function createGridHelper(size = 150, ...args) {\r\n return new GridHelper(size, size / 10, ...args);\r\n}\r\n\r\nexport function createBox3Helper(model) {\r\n return new BoxHelper(model, 0xffff00);\r\n}\r\n\r\nexport function createOrbitControl(camera, dom) {\r\n return new OrbitControls(camera, dom);\r\n}\r\n\r\nexport function createMapControls(camera, dom) {\r\n return new MapControls(camera, dom);\r\n}\r\n\r\nexport function createRaycaster() {\r\n const raycaster = new Raycaster();\r\n const pointer = new Vector2(0, 0);\r\n return {\r\n raycaster,\r\n pointer,\r\n };\r\n}\r\n\r\nexport function createAxesHelper(size = 10) {\r\n return new AxesHelper(size);\r\n}\r\n\r\nexport function createArrowHelper(\r\n dir = new Vector3(1, 1, 1),\r\n ori = new Vector3(10, 10, 10),\r\n length = 5,\r\n hex = 0xffff00\r\n) {\r\n dir.normalize();\r\n return new ArrowHelper(dir, ori, length, hex);\r\n}\r\n\r\nexport function createStats() {\r\n const stats = new Stats();\r\n stats.dom.style.cssText =\r\n \"position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000\";\r\n return stats;\r\n}\r\n",
1570
- "static": true,
1571
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/helper.js",
1572
- "access": "public",
1573
- "description": null,
1574
- "lineNumber": 1
1575
- },
1576
- {
1577
- "__docId__": 86,
1578
- "kind": "function",
1579
- "name": "createCameraHelper",
1580
- "memberof": "src/utils/helper.js",
1581
- "generator": false,
1582
- "async": false,
1583
- "static": true,
1584
- "longname": "src/utils/helper.js~createCameraHelper",
1585
- "access": "public",
1586
- "export": true,
1587
- "importPath": "@ridp/threejs/src/utils/helper.js",
1588
- "importStyle": "{createCameraHelper}",
1589
- "description": null,
1590
- "lineNumber": 15,
1591
- "undocument": true,
1592
- "params": [
1593
- {
1594
- "name": "camera",
1595
- "types": [
1596
- "*"
1597
- ]
1598
- }
1599
- ],
1600
- "return": {
1601
- "types": [
1602
- "*"
1603
- ]
1604
- }
1605
- },
1606
- {
1607
- "__docId__": 87,
1608
- "kind": "function",
1609
- "name": "createGridHelper",
1610
- "memberof": "src/utils/helper.js",
1611
- "generator": false,
1612
- "async": false,
1613
- "static": true,
1614
- "longname": "src/utils/helper.js~createGridHelper",
1615
- "access": "public",
1616
- "export": true,
1617
- "importPath": "@ridp/threejs/src/utils/helper.js",
1618
- "importStyle": "{createGridHelper}",
1619
- "description": null,
1620
- "lineNumber": 19,
1621
- "undocument": true,
1622
- "params": [
1623
- {
1624
- "name": "size",
1625
- "optional": true,
1626
- "types": [
1627
- "number"
1628
- ],
1629
- "defaultRaw": 150,
1630
- "defaultValue": "150"
1631
- },
1632
- {
1633
- "name": "args",
1634
- "types": [
1635
- "...*"
1636
- ],
1637
- "spread": true
1638
- }
1639
- ],
1640
- "return": {
1641
- "types": [
1642
- "*"
1643
- ]
1644
- }
1645
- },
1646
- {
1647
- "__docId__": 88,
1648
- "kind": "function",
1649
- "name": "createBox3Helper",
1650
- "memberof": "src/utils/helper.js",
1651
- "generator": false,
1652
- "async": false,
1653
- "static": true,
1654
- "longname": "src/utils/helper.js~createBox3Helper",
1655
- "access": "public",
1656
- "export": true,
1657
- "importPath": "@ridp/threejs/src/utils/helper.js",
1658
- "importStyle": "{createBox3Helper}",
1659
- "description": null,
1660
- "lineNumber": 23,
1661
- "undocument": true,
1662
- "params": [
1663
- {
1664
- "name": "model",
1665
- "types": [
1666
- "*"
1667
- ]
1668
- }
1669
- ],
1670
- "return": {
1671
- "types": [
1672
- "*"
1673
- ]
1674
- }
1675
- },
1676
- {
1677
- "__docId__": 89,
1678
- "kind": "function",
1679
- "name": "createOrbitControl",
1680
- "memberof": "src/utils/helper.js",
1681
- "generator": false,
1682
- "async": false,
1683
- "static": true,
1684
- "longname": "src/utils/helper.js~createOrbitControl",
1685
- "access": "public",
1686
- "export": true,
1687
- "importPath": "@ridp/threejs/src/utils/helper.js",
1688
- "importStyle": "{createOrbitControl}",
1689
- "description": null,
1690
- "lineNumber": 27,
1691
- "undocument": true,
1692
- "params": [
1693
- {
1694
- "name": "camera",
1695
- "types": [
1696
- "*"
1697
- ]
1698
- },
1699
- {
1700
- "name": "dom",
1701
- "types": [
1702
- "*"
1703
- ]
1704
- }
1705
- ],
1706
- "return": {
1707
- "types": [
1708
- "*"
1709
- ]
1710
- }
1711
- },
1712
- {
1713
- "__docId__": 90,
1714
- "kind": "function",
1715
- "name": "createMapControls",
1716
- "memberof": "src/utils/helper.js",
1717
- "generator": false,
1718
- "async": false,
1719
- "static": true,
1720
- "longname": "src/utils/helper.js~createMapControls",
1721
- "access": "public",
1722
- "export": true,
1723
- "importPath": "@ridp/threejs/src/utils/helper.js",
1724
- "importStyle": "{createMapControls}",
1725
- "description": null,
1726
- "lineNumber": 31,
1727
- "undocument": true,
1728
- "params": [
1729
- {
1730
- "name": "camera",
1731
- "types": [
1732
- "*"
1733
- ]
1734
- },
1735
- {
1736
- "name": "dom",
1737
- "types": [
1738
- "*"
1739
- ]
1740
- }
1741
- ],
1742
- "return": {
1743
- "types": [
1744
- "*"
1745
- ]
1746
- }
1747
- },
1748
- {
1749
- "__docId__": 91,
1750
- "kind": "function",
1751
- "name": "createRaycaster",
1752
- "memberof": "src/utils/helper.js",
1753
- "generator": false,
1754
- "async": false,
1755
- "static": true,
1756
- "longname": "src/utils/helper.js~createRaycaster",
1757
- "access": "public",
1758
- "export": true,
1759
- "importPath": "@ridp/threejs/src/utils/helper.js",
1760
- "importStyle": "{createRaycaster}",
1761
- "description": null,
1762
- "lineNumber": 35,
1763
- "undocument": true,
1764
- "params": [],
1765
- "return": {
1766
- "types": [
1767
- "{\"raycaster\": *, \"pointer\": *}"
1768
- ]
1769
- }
1770
- },
1771
- {
1772
- "__docId__": 92,
1773
- "kind": "function",
1774
- "name": "createAxesHelper",
1775
- "memberof": "src/utils/helper.js",
1776
- "generator": false,
1777
- "async": false,
1778
- "static": true,
1779
- "longname": "src/utils/helper.js~createAxesHelper",
1780
- "access": "public",
1781
- "export": true,
1782
- "importPath": "@ridp/threejs/src/utils/helper.js",
1783
- "importStyle": "{createAxesHelper}",
1784
- "description": null,
1785
- "lineNumber": 44,
1786
- "undocument": true,
1787
- "params": [
1788
- {
1789
- "name": "size",
1790
- "optional": true,
1791
- "types": [
1792
- "number"
1793
- ],
1794
- "defaultRaw": 10,
1795
- "defaultValue": "10"
1796
- }
1797
- ],
1798
- "return": {
1799
- "types": [
1800
- "*"
1801
- ]
1802
- }
1803
- },
1804
- {
1805
- "__docId__": 93,
1806
- "kind": "function",
1807
- "name": "createArrowHelper",
1808
- "memberof": "src/utils/helper.js",
1809
- "generator": false,
1810
- "async": false,
1811
- "static": true,
1812
- "longname": "src/utils/helper.js~createArrowHelper",
1813
- "access": "public",
1814
- "export": true,
1815
- "importPath": "@ridp/threejs/src/utils/helper.js",
1816
- "importStyle": "{createArrowHelper}",
1817
- "description": null,
1818
- "lineNumber": 48,
1819
- "undocument": true,
1820
- "params": [
1821
- {
1822
- "name": "dir",
1823
- "optional": true,
1824
- "types": [
1825
- "*"
1826
- ]
1827
- },
1828
- {
1829
- "name": "ori",
1830
- "optional": true,
1831
- "types": [
1832
- "*"
1833
- ]
1834
- },
1835
- {
1836
- "name": "length",
1837
- "optional": true,
1838
- "types": [
1839
- "number"
1840
- ],
1841
- "defaultRaw": 5,
1842
- "defaultValue": "5"
1843
- },
1844
- {
1845
- "name": "hex",
1846
- "optional": true,
1847
- "types": [
1848
- "number"
1849
- ],
1850
- "defaultRaw": 16776960,
1851
- "defaultValue": "16776960"
1852
- }
1853
- ],
1854
- "return": {
1855
- "types": [
1856
- "*"
1857
- ]
1858
- }
1859
- },
1860
- {
1861
- "__docId__": 94,
1862
- "kind": "function",
1863
- "name": "createStats",
1864
- "memberof": "src/utils/helper.js",
1865
- "generator": false,
1866
- "async": false,
1867
- "static": true,
1868
- "longname": "src/utils/helper.js~createStats",
1869
- "access": "public",
1870
- "export": true,
1871
- "importPath": "@ridp/threejs/src/utils/helper.js",
1872
- "importStyle": "{createStats}",
1873
- "description": null,
1874
- "lineNumber": 58,
1875
- "undocument": true,
1876
- "params": [],
1877
- "return": {
1878
- "types": [
1879
- "*"
1880
- ]
1881
- }
1882
- },
1883
- {
1884
- "__docId__": 95,
1885
- "kind": "file",
1886
- "name": "src/utils/ImageLoader.js",
1887
- "content": "import { RGBELoader } from \"three/examples/jsm/Addons.js\";\r\nimport { EquirectangularReflectionMapping } from \"three\";\r\n\r\nconst cacheHdr = {};\r\n\r\nconst rgbeLoader = new RGBELoader();\r\n/**\r\n * 环境贴图加载 && 缓存 && 设置到 scene\r\n * @param { THREE.Scene } scene threejs 场景对象\r\n * @param { String } path 图片地址\r\n * @returns\r\n */\r\nexport async function initEnvImage(scene, path) {\r\n if (!path) return;\r\n if (cacheHdr[path]) {\r\n const texture = cacheHdr[path];\r\n scene.environment = texture;\r\n return;\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n rgbeLoader.load(path, resolve, undefined, reject);\r\n })\r\n .then((texture) => {\r\n texture.mapping = EquirectangularReflectionMapping;\r\n scene.environment = texture;\r\n cacheHdr[path] = texture;\r\n })\r\n .catch((e) => {\r\n console.log(\" =====> e:\", e);\r\n });\r\n}\r\n\r\n/**\r\n * 图片纹理加载\r\n * @param {*} path 图片路径\r\n * @returns\r\n */\r\nexport async function ImageLoader(path) {\r\n return new Promise((resolve, reject) => {\r\n rgbeLoader.load(path, resolve, undefined, reject);\r\n });\r\n}\r\n",
1888
- "static": true,
1889
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/ImageLoader.js",
1890
- "access": "public",
1891
- "description": null,
1892
- "lineNumber": 1
1893
- },
1894
- {
1895
- "__docId__": 96,
1896
- "kind": "variable",
1897
- "name": "cacheHdr",
1898
- "memberof": "src/utils/ImageLoader.js",
1899
- "static": true,
1900
- "longname": "src/utils/ImageLoader.js~cacheHdr",
1901
- "access": "public",
1902
- "export": false,
1903
- "importPath": "@ridp/threejs/src/utils/ImageLoader.js",
1904
- "importStyle": null,
1905
- "description": null,
1906
- "lineNumber": 4,
1907
- "undocument": true,
1908
- "type": {
1909
- "types": [
1910
- "{}"
1911
- ]
1912
- },
1913
- "ignore": true
1914
- },
1915
- {
1916
- "__docId__": 97,
1917
- "kind": "variable",
1918
- "name": "rgbeLoader",
1919
- "memberof": "src/utils/ImageLoader.js",
1920
- "static": true,
1921
- "longname": "src/utils/ImageLoader.js~rgbeLoader",
1922
- "access": "public",
1923
- "export": false,
1924
- "importPath": "@ridp/threejs/src/utils/ImageLoader.js",
1925
- "importStyle": null,
1926
- "description": null,
1927
- "lineNumber": 6,
1928
- "undocument": true,
1929
- "type": {
1930
- "types": [
1931
- "*"
1932
- ]
1933
- },
1934
- "ignore": true
1935
- },
1936
- {
1937
- "__docId__": 98,
1938
- "kind": "function",
1939
- "name": "initEnvImage",
1940
- "memberof": "src/utils/ImageLoader.js",
1941
- "generator": false,
1942
- "async": true,
1943
- "static": true,
1944
- "longname": "src/utils/ImageLoader.js~initEnvImage",
1945
- "access": "public",
1946
- "export": true,
1947
- "importPath": "@ridp/threejs/src/utils/ImageLoader.js",
1948
- "importStyle": "{initEnvImage}",
1949
- "description": "环境贴图加载 && 缓存 && 设置到 scene",
1950
- "lineNumber": 13,
1951
- "unknown": [
1952
- {
1953
- "tagName": "@returns",
1954
- "tagValue": ""
1955
- }
1956
- ],
1957
- "params": [
1958
- {
1959
- "nullable": null,
1960
- "types": [
1961
- " THREE.Scene "
1962
- ],
1963
- "spread": false,
1964
- "optional": false,
1965
- "name": "scene",
1966
- "description": "threejs 场景对象"
1967
- },
1968
- {
1969
- "nullable": null,
1970
- "types": [
1971
- " String "
1972
- ],
1973
- "spread": false,
1974
- "optional": false,
1975
- "name": "path",
1976
- "description": "图片地址"
1977
- }
1978
- ],
1979
- "return": {
1980
- "types": [
1981
- "*"
1982
- ]
1983
- }
1984
- },
1985
- {
1986
- "__docId__": 99,
1987
- "kind": "function",
1988
- "name": "ImageLoader",
1989
- "memberof": "src/utils/ImageLoader.js",
1990
- "generator": false,
1991
- "async": true,
1992
- "static": true,
1993
- "longname": "src/utils/ImageLoader.js~ImageLoader",
1994
- "access": "public",
1995
- "export": true,
1996
- "importPath": "@ridp/threejs/src/utils/ImageLoader.js",
1997
- "importStyle": "{ImageLoader}",
1998
- "description": "图片纹理加载",
1999
- "lineNumber": 39,
2000
- "unknown": [
2001
- {
2002
- "tagName": "@returns",
2003
- "tagValue": ""
2004
- }
2005
- ],
2006
- "params": [
2007
- {
2008
- "nullable": null,
2009
- "types": [
2010
- "*"
2011
- ],
2012
- "spread": false,
2013
- "optional": false,
2014
- "name": "path",
2015
- "description": "图片路径"
2016
- }
2017
- ],
2018
- "return": {
2019
- "types": [
2020
- "*"
2021
- ]
2022
- }
2023
- },
2024
- {
2025
- "__docId__": 100,
2026
- "kind": "file",
2027
- "name": "src/utils/index.js",
2028
- "content": "export * from \"./helper.js\";\r\nexport * from \"./css3dHelper.js\";\r\nexport * from \"./disposeObject.js\";\r\nexport * from \"./common.js\";\r\nexport * from \"./ImageLoader.js\";\r\n",
2029
- "static": true,
2030
- "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/index.js",
2031
- "access": "public",
2032
- "description": null,
2033
- "lineNumber": 1
2034
- },
2035
- {
2036
- "kind": "index",
2037
- "content": "# @ridp/threejs \r\n\r\n## Hooks \r\n\r\n- useThreeJs\r\n 声明: \r\n\r\n ```javascript\r\n /**\r\n * \r\n * @param {String} selector ID '#xxxx'\r\n * @param {Object} option - 初始化参数\r\n * @property {Boolean} option.css3d - 模型\r\n * @returns any\r\n */\r\n function useThreeJs(selector, option)\r\n ```\r\n\r\n 使用: \r\n ```javascript\r\n import { useThreeJs } from '@ridp/threejs'\r\n\r\n const { scene, camera, renderer, control, domWidth, domHeight, isReady, addAnimate, frameArea } = useThreeJs(\"#InsId\", )\r\n\r\n ```\r\n ---- \r\n 返回变量: \r\n * scene\r\n ```javascript \r\n THREE.Scene \r\n\r\n ```\r\n * camera: \r\n ```javascript \r\n THREE.PerspectiveCamera \r\n ```\r\n * renderer\r\n ```javascript \r\n const renderer = new WebGLRenderer({\r\n antialias: true,\r\n alpha: true,\r\n precision: \"mediump\",\r\n logarithmicDepthBuffer: true,\r\n })\r\n ```\r\n * control\r\n ```javascript \r\n THREE.OrbitControls\r\n ```\r\n * domWidth\r\n ```javascript\r\n ref(Number)\r\n ```\r\n * domHeight\r\n ```javascript\r\n ref(Number)\r\n ```\r\n * isReady \r\n ```javascript\r\n ref(Boolean)\r\n ```\r\n ------ \r\n 返回方法: \r\n * addAnimate \r\n ```javascript\r\n /**\r\n * 循环帧中添加执行函数\r\n * @param {*} animate \r\n */\r\n function addAnimate(animate): void\r\n\r\n ```\r\n\r\n * frameArea \r\n ```javascript\r\n /**物体视窗自动适应\r\n *\r\n * @param {Object3D} model\r\n * @param {Number} scale\r\n * @param {Camera} camera\r\n * @param {OrbitControls} controls\r\n * @param {Vector3} offset\r\n */\r\n function frameArea(model, scale, camera, controls, offset): void\r\n ```\r\n- useRaycaster\r\n- useObb\r\n- useGLTFLoader\r\n\r\n# Instance 实例\r\n\r\n\r\n# Utils 工具",
2038
- "longname": "C:\\project\\RIDP.HMC_3D_Visualization-dev\\packages\\threejs\\README.md",
2039
- "name": "./README.md",
2040
- "static": true,
2041
- "access": "public"
2042
- },
2043
- {
2044
- "kind": "packageJSON",
2045
- "content": "{\n \"name\": \"@ridp/threejs\",\n \"private\": false,\n \"version\": \"1.0.0\",\n \"type\": \"module\",\n \"main\": \"dist/threejs.js\",\n \"scripts\": {\n \"build\": \"vite build\",\n \"build:doc\": \"npx esdoc\"\n },\n \"exports\": {\n \".\": {\n \"import\": \"./dist/threejs.js\",\n \"require\": \"./dist/threejs.cjs\"\n },\n \"./hooks\": {\n \"import\": \"./dist/hooks.js\",\n \"require\": \"./dist/hooks.cjs\"\n },\n \"./utils\": {\n \"import\": \"./dist/utils.js\",\n \"require\": \"./dist/utils.cjs\"\n }\n },\n \"dependencies\": {\n \"dexie\": \"^4.0.11\",\n \"esdoc\": \"^1.1.0\",\n \"esdoc-ecmascript-proposal-plugin\": \"^1.0.0\",\n \"esdoc-importpath-plugin\": \"^1.0.2\",\n \"esdoc-inject-style-plugin\": \"^1.0.0\",\n \"esdoc-jsx-plugin\": \"^1.0.0\",\n \"esdoc-standard-plugin\": \"^1.0.0\",\n \"three\": \"^0.175.0\",\n \"vite\": \"^6.3.1\",\n \"vue\": \"^3.5.13\"\n },\n \"files\": [\n \"dist/*\",\n \"static/\"\n ],\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n",
2046
- "longname": "C:\\project\\RIDP.HMC_3D_Visualization-dev\\packages\\threejs\\package.json",
2047
- "name": "package.json",
2048
- "static": true,
2049
- "access": "public"
2050
- }
1
+ [
2
+ {
3
+ "__docId__": 1,
4
+ "kind": "external",
5
+ "name": "Infinity",
6
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity",
7
+ "memberof": "src/.external-ecmascript.js",
8
+ "static": true,
9
+ "longname": "src/.external-ecmascript.js~Infinity",
10
+ "access": "public",
11
+ "description": "",
12
+ "builtinExternal": true
13
+ },
14
+ {
15
+ "__docId__": 2,
16
+ "kind": "external",
17
+ "name": "NaN",
18
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN",
19
+ "memberof": "src/.external-ecmascript.js",
20
+ "static": true,
21
+ "longname": "src/.external-ecmascript.js~NaN",
22
+ "access": "public",
23
+ "description": "",
24
+ "builtinExternal": true
25
+ },
26
+ {
27
+ "__docId__": 3,
28
+ "kind": "external",
29
+ "name": "undefined",
30
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
31
+ "memberof": "src/.external-ecmascript.js",
32
+ "static": true,
33
+ "longname": "src/.external-ecmascript.js~undefined",
34
+ "access": "public",
35
+ "description": "",
36
+ "builtinExternal": true
37
+ },
38
+ {
39
+ "__docId__": 4,
40
+ "kind": "external",
41
+ "name": "null",
42
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",
43
+ "memberof": "src/.external-ecmascript.js",
44
+ "static": true,
45
+ "longname": "src/.external-ecmascript.js~null",
46
+ "access": "public",
47
+ "description": "",
48
+ "builtinExternal": true
49
+ },
50
+ {
51
+ "__docId__": 5,
52
+ "kind": "external",
53
+ "name": "Object",
54
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
55
+ "memberof": "src/.external-ecmascript.js",
56
+ "static": true,
57
+ "longname": "src/.external-ecmascript.js~Object",
58
+ "access": "public",
59
+ "description": "",
60
+ "builtinExternal": true
61
+ },
62
+ {
63
+ "__docId__": 6,
64
+ "kind": "external",
65
+ "name": "object",
66
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
67
+ "memberof": "src/.external-ecmascript.js",
68
+ "static": true,
69
+ "longname": "src/.external-ecmascript.js~object",
70
+ "access": "public",
71
+ "description": "",
72
+ "builtinExternal": true
73
+ },
74
+ {
75
+ "__docId__": 7,
76
+ "kind": "external",
77
+ "name": "Function",
78
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
79
+ "memberof": "src/.external-ecmascript.js",
80
+ "static": true,
81
+ "longname": "src/.external-ecmascript.js~Function",
82
+ "access": "public",
83
+ "description": "",
84
+ "builtinExternal": true
85
+ },
86
+ {
87
+ "__docId__": 8,
88
+ "kind": "external",
89
+ "name": "function",
90
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
91
+ "memberof": "src/.external-ecmascript.js",
92
+ "static": true,
93
+ "longname": "src/.external-ecmascript.js~function",
94
+ "access": "public",
95
+ "description": "",
96
+ "builtinExternal": true
97
+ },
98
+ {
99
+ "__docId__": 9,
100
+ "kind": "external",
101
+ "name": "Boolean",
102
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
103
+ "memberof": "src/.external-ecmascript.js",
104
+ "static": true,
105
+ "longname": "src/.external-ecmascript.js~Boolean",
106
+ "access": "public",
107
+ "description": "",
108
+ "builtinExternal": true
109
+ },
110
+ {
111
+ "__docId__": 10,
112
+ "kind": "external",
113
+ "name": "boolean",
114
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
115
+ "memberof": "src/.external-ecmascript.js",
116
+ "static": true,
117
+ "longname": "src/.external-ecmascript.js~boolean",
118
+ "access": "public",
119
+ "description": "",
120
+ "builtinExternal": true
121
+ },
122
+ {
123
+ "__docId__": 11,
124
+ "kind": "external",
125
+ "name": "Symbol",
126
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol",
127
+ "memberof": "src/.external-ecmascript.js",
128
+ "static": true,
129
+ "longname": "src/.external-ecmascript.js~Symbol",
130
+ "access": "public",
131
+ "description": "",
132
+ "builtinExternal": true
133
+ },
134
+ {
135
+ "__docId__": 12,
136
+ "kind": "external",
137
+ "name": "Error",
138
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
139
+ "memberof": "src/.external-ecmascript.js",
140
+ "static": true,
141
+ "longname": "src/.external-ecmascript.js~Error",
142
+ "access": "public",
143
+ "description": "",
144
+ "builtinExternal": true
145
+ },
146
+ {
147
+ "__docId__": 13,
148
+ "kind": "external",
149
+ "name": "EvalError",
150
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError",
151
+ "memberof": "src/.external-ecmascript.js",
152
+ "static": true,
153
+ "longname": "src/.external-ecmascript.js~EvalError",
154
+ "access": "public",
155
+ "description": "",
156
+ "builtinExternal": true
157
+ },
158
+ {
159
+ "__docId__": 14,
160
+ "kind": "external",
161
+ "name": "InternalError",
162
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError",
163
+ "memberof": "src/.external-ecmascript.js",
164
+ "static": true,
165
+ "longname": "src/.external-ecmascript.js~InternalError",
166
+ "access": "public",
167
+ "description": "",
168
+ "builtinExternal": true
169
+ },
170
+ {
171
+ "__docId__": 15,
172
+ "kind": "external",
173
+ "name": "RangeError",
174
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError",
175
+ "memberof": "src/.external-ecmascript.js",
176
+ "static": true,
177
+ "longname": "src/.external-ecmascript.js~RangeError",
178
+ "access": "public",
179
+ "description": "",
180
+ "builtinExternal": true
181
+ },
182
+ {
183
+ "__docId__": 16,
184
+ "kind": "external",
185
+ "name": "ReferenceError",
186
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError",
187
+ "memberof": "src/.external-ecmascript.js",
188
+ "static": true,
189
+ "longname": "src/.external-ecmascript.js~ReferenceError",
190
+ "access": "public",
191
+ "description": "",
192
+ "builtinExternal": true
193
+ },
194
+ {
195
+ "__docId__": 17,
196
+ "kind": "external",
197
+ "name": "SyntaxError",
198
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError",
199
+ "memberof": "src/.external-ecmascript.js",
200
+ "static": true,
201
+ "longname": "src/.external-ecmascript.js~SyntaxError",
202
+ "access": "public",
203
+ "description": "",
204
+ "builtinExternal": true
205
+ },
206
+ {
207
+ "__docId__": 18,
208
+ "kind": "external",
209
+ "name": "TypeError",
210
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
211
+ "memberof": "src/.external-ecmascript.js",
212
+ "static": true,
213
+ "longname": "src/.external-ecmascript.js~TypeError",
214
+ "access": "public",
215
+ "description": "",
216
+ "builtinExternal": true
217
+ },
218
+ {
219
+ "__docId__": 19,
220
+ "kind": "external",
221
+ "name": "URIError",
222
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError",
223
+ "memberof": "src/.external-ecmascript.js",
224
+ "static": true,
225
+ "longname": "src/.external-ecmascript.js~URIError",
226
+ "access": "public",
227
+ "description": "",
228
+ "builtinExternal": true
229
+ },
230
+ {
231
+ "__docId__": 20,
232
+ "kind": "external",
233
+ "name": "Number",
234
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
235
+ "memberof": "src/.external-ecmascript.js",
236
+ "static": true,
237
+ "longname": "src/.external-ecmascript.js~Number",
238
+ "access": "public",
239
+ "description": "",
240
+ "builtinExternal": true
241
+ },
242
+ {
243
+ "__docId__": 21,
244
+ "kind": "external",
245
+ "name": "number",
246
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
247
+ "memberof": "src/.external-ecmascript.js",
248
+ "static": true,
249
+ "longname": "src/.external-ecmascript.js~number",
250
+ "access": "public",
251
+ "description": "",
252
+ "builtinExternal": true
253
+ },
254
+ {
255
+ "__docId__": 22,
256
+ "kind": "external",
257
+ "name": "Date",
258
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
259
+ "memberof": "src/.external-ecmascript.js",
260
+ "static": true,
261
+ "longname": "src/.external-ecmascript.js~Date",
262
+ "access": "public",
263
+ "description": "",
264
+ "builtinExternal": true
265
+ },
266
+ {
267
+ "__docId__": 23,
268
+ "kind": "external",
269
+ "name": "String",
270
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
271
+ "memberof": "src/.external-ecmascript.js",
272
+ "static": true,
273
+ "longname": "src/.external-ecmascript.js~String",
274
+ "access": "public",
275
+ "description": "",
276
+ "builtinExternal": true
277
+ },
278
+ {
279
+ "__docId__": 24,
280
+ "kind": "external",
281
+ "name": "string",
282
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
283
+ "memberof": "src/.external-ecmascript.js",
284
+ "static": true,
285
+ "longname": "src/.external-ecmascript.js~string",
286
+ "access": "public",
287
+ "description": "",
288
+ "builtinExternal": true
289
+ },
290
+ {
291
+ "__docId__": 25,
292
+ "kind": "external",
293
+ "name": "RegExp",
294
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
295
+ "memberof": "src/.external-ecmascript.js",
296
+ "static": true,
297
+ "longname": "src/.external-ecmascript.js~RegExp",
298
+ "access": "public",
299
+ "description": "",
300
+ "builtinExternal": true
301
+ },
302
+ {
303
+ "__docId__": 26,
304
+ "kind": "external",
305
+ "name": "Array",
306
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
307
+ "memberof": "src/.external-ecmascript.js",
308
+ "static": true,
309
+ "longname": "src/.external-ecmascript.js~Array",
310
+ "access": "public",
311
+ "description": "",
312
+ "builtinExternal": true
313
+ },
314
+ {
315
+ "__docId__": 27,
316
+ "kind": "external",
317
+ "name": "Int8Array",
318
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",
319
+ "memberof": "src/.external-ecmascript.js",
320
+ "static": true,
321
+ "longname": "src/.external-ecmascript.js~Int8Array",
322
+ "access": "public",
323
+ "description": "",
324
+ "builtinExternal": true
325
+ },
326
+ {
327
+ "__docId__": 28,
328
+ "kind": "external",
329
+ "name": "Uint8Array",
330
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",
331
+ "memberof": "src/.external-ecmascript.js",
332
+ "static": true,
333
+ "longname": "src/.external-ecmascript.js~Uint8Array",
334
+ "access": "public",
335
+ "description": "",
336
+ "builtinExternal": true
337
+ },
338
+ {
339
+ "__docId__": 29,
340
+ "kind": "external",
341
+ "name": "Uint8ClampedArray",
342
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",
343
+ "memberof": "src/.external-ecmascript.js",
344
+ "static": true,
345
+ "longname": "src/.external-ecmascript.js~Uint8ClampedArray",
346
+ "access": "public",
347
+ "description": "",
348
+ "builtinExternal": true
349
+ },
350
+ {
351
+ "__docId__": 30,
352
+ "kind": "external",
353
+ "name": "Int16Array",
354
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",
355
+ "memberof": "src/.external-ecmascript.js",
356
+ "static": true,
357
+ "longname": "src/.external-ecmascript.js~Int16Array",
358
+ "access": "public",
359
+ "description": "",
360
+ "builtinExternal": true
361
+ },
362
+ {
363
+ "__docId__": 31,
364
+ "kind": "external",
365
+ "name": "Uint16Array",
366
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",
367
+ "memberof": "src/.external-ecmascript.js",
368
+ "static": true,
369
+ "longname": "src/.external-ecmascript.js~Uint16Array",
370
+ "access": "public",
371
+ "description": "",
372
+ "builtinExternal": true
373
+ },
374
+ {
375
+ "__docId__": 32,
376
+ "kind": "external",
377
+ "name": "Int32Array",
378
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",
379
+ "memberof": "src/.external-ecmascript.js",
380
+ "static": true,
381
+ "longname": "src/.external-ecmascript.js~Int32Array",
382
+ "access": "public",
383
+ "description": "",
384
+ "builtinExternal": true
385
+ },
386
+ {
387
+ "__docId__": 33,
388
+ "kind": "external",
389
+ "name": "Uint32Array",
390
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",
391
+ "memberof": "src/.external-ecmascript.js",
392
+ "static": true,
393
+ "longname": "src/.external-ecmascript.js~Uint32Array",
394
+ "access": "public",
395
+ "description": "",
396
+ "builtinExternal": true
397
+ },
398
+ {
399
+ "__docId__": 34,
400
+ "kind": "external",
401
+ "name": "Float32Array",
402
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",
403
+ "memberof": "src/.external-ecmascript.js",
404
+ "static": true,
405
+ "longname": "src/.external-ecmascript.js~Float32Array",
406
+ "access": "public",
407
+ "description": "",
408
+ "builtinExternal": true
409
+ },
410
+ {
411
+ "__docId__": 35,
412
+ "kind": "external",
413
+ "name": "Float64Array",
414
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",
415
+ "memberof": "src/.external-ecmascript.js",
416
+ "static": true,
417
+ "longname": "src/.external-ecmascript.js~Float64Array",
418
+ "access": "public",
419
+ "description": "",
420
+ "builtinExternal": true
421
+ },
422
+ {
423
+ "__docId__": 36,
424
+ "kind": "external",
425
+ "name": "Map",
426
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",
427
+ "memberof": "src/.external-ecmascript.js",
428
+ "static": true,
429
+ "longname": "src/.external-ecmascript.js~Map",
430
+ "access": "public",
431
+ "description": "",
432
+ "builtinExternal": true
433
+ },
434
+ {
435
+ "__docId__": 37,
436
+ "kind": "external",
437
+ "name": "Set",
438
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",
439
+ "memberof": "src/.external-ecmascript.js",
440
+ "static": true,
441
+ "longname": "src/.external-ecmascript.js~Set",
442
+ "access": "public",
443
+ "description": "",
444
+ "builtinExternal": true
445
+ },
446
+ {
447
+ "__docId__": 38,
448
+ "kind": "external",
449
+ "name": "WeakMap",
450
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",
451
+ "memberof": "src/.external-ecmascript.js",
452
+ "static": true,
453
+ "longname": "src/.external-ecmascript.js~WeakMap",
454
+ "access": "public",
455
+ "description": "",
456
+ "builtinExternal": true
457
+ },
458
+ {
459
+ "__docId__": 39,
460
+ "kind": "external",
461
+ "name": "WeakSet",
462
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",
463
+ "memberof": "src/.external-ecmascript.js",
464
+ "static": true,
465
+ "longname": "src/.external-ecmascript.js~WeakSet",
466
+ "access": "public",
467
+ "description": "",
468
+ "builtinExternal": true
469
+ },
470
+ {
471
+ "__docId__": 40,
472
+ "kind": "external",
473
+ "name": "ArrayBuffer",
474
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",
475
+ "memberof": "src/.external-ecmascript.js",
476
+ "static": true,
477
+ "longname": "src/.external-ecmascript.js~ArrayBuffer",
478
+ "access": "public",
479
+ "description": "",
480
+ "builtinExternal": true
481
+ },
482
+ {
483
+ "__docId__": 41,
484
+ "kind": "external",
485
+ "name": "DataView",
486
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",
487
+ "memberof": "src/.external-ecmascript.js",
488
+ "static": true,
489
+ "longname": "src/.external-ecmascript.js~DataView",
490
+ "access": "public",
491
+ "description": "",
492
+ "builtinExternal": true
493
+ },
494
+ {
495
+ "__docId__": 42,
496
+ "kind": "external",
497
+ "name": "JSON",
498
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON",
499
+ "memberof": "src/.external-ecmascript.js",
500
+ "static": true,
501
+ "longname": "src/.external-ecmascript.js~JSON",
502
+ "access": "public",
503
+ "description": "",
504
+ "builtinExternal": true
505
+ },
506
+ {
507
+ "__docId__": 43,
508
+ "kind": "external",
509
+ "name": "Promise",
510
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
511
+ "memberof": "src/.external-ecmascript.js",
512
+ "static": true,
513
+ "longname": "src/.external-ecmascript.js~Promise",
514
+ "access": "public",
515
+ "description": "",
516
+ "builtinExternal": true
517
+ },
518
+ {
519
+ "__docId__": 44,
520
+ "kind": "external",
521
+ "name": "Generator",
522
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator",
523
+ "memberof": "src/.external-ecmascript.js",
524
+ "static": true,
525
+ "longname": "src/.external-ecmascript.js~Generator",
526
+ "access": "public",
527
+ "description": "",
528
+ "builtinExternal": true
529
+ },
530
+ {
531
+ "__docId__": 45,
532
+ "kind": "external",
533
+ "name": "GeneratorFunction",
534
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction",
535
+ "memberof": "src/.external-ecmascript.js",
536
+ "static": true,
537
+ "longname": "src/.external-ecmascript.js~GeneratorFunction",
538
+ "access": "public",
539
+ "description": "",
540
+ "builtinExternal": true
541
+ },
542
+ {
543
+ "__docId__": 46,
544
+ "kind": "external",
545
+ "name": "Reflect",
546
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect",
547
+ "memberof": "src/.external-ecmascript.js",
548
+ "static": true,
549
+ "longname": "src/.external-ecmascript.js~Reflect",
550
+ "access": "public",
551
+ "description": "",
552
+ "builtinExternal": true
553
+ },
554
+ {
555
+ "__docId__": 47,
556
+ "kind": "external",
557
+ "name": "Proxy",
558
+ "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
559
+ "memberof": "src/.external-ecmascript.js",
560
+ "static": true,
561
+ "longname": "src/.external-ecmascript.js~Proxy",
562
+ "access": "public",
563
+ "description": "",
564
+ "builtinExternal": true
565
+ },
566
+ {
567
+ "__docId__": 48,
568
+ "kind": "file",
569
+ "name": "src/hooks/index.js",
570
+ "content": "export * from \"./useThreeJs\";\r\nexport * from \"./useRaycaster\";\r\nexport * from \"./useObb\";\r\nexport * from \"./useGLTFLoader\";\r\n",
571
+ "static": true,
572
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/index.js",
573
+ "access": "public",
574
+ "description": null,
575
+ "lineNumber": 1
576
+ },
577
+ {
578
+ "__docId__": 49,
579
+ "kind": "file",
580
+ "name": "src/hooks/useGLTFLoader.js",
581
+ "content": "import { GLTFLoader } from \"three/addons/loaders/GLTFLoader.js\";\r\nimport { DRACOLoader } from \"three/addons/loaders/DRACOLoader.js\";\r\nimport { IDBCache } from \"../instance/IDBCache\";\r\n\r\n/** @type { IDBCache } */\r\nlet idbCache;\r\n\r\n/**\r\n * GLTFLoader 模型加载器\r\n * @returns { Object }\r\n * @property { Function } load - 模型加载方法\r\n * @property { Function } asyncLoad - Promise 形式异步加载模型方法\r\n * @property { Function } asyncCacheLoad - Promise 形式异步加载模型并缓存方法\r\n */\r\nexport const useGLTFLoader = () => {\r\n const loader = new GLTFLoader();\r\n const dracoLoader = new DRACOLoader();\r\n dracoLoader.setDecoderPath(`/draco/`);\r\n loader.setDRACOLoader(dracoLoader);\r\n\r\n /**\r\n * 模型加载\r\n * @param { String } path - 模型路径\r\n * @param {Function} onLoad - 加载完成回调\r\n * @param {Function} onProgress - 进度回调\r\n * @param {Function} onError - 错误回调\r\n * @returns { GLTFLoader.load }\r\n */\r\n function load(path, onLoad, onProgress, onError) {\r\n return loader.load(path, onLoad, onProgress, onError);\r\n }\r\n\r\n /**\r\n * Promise 形式异步加载模型\r\n * @param {String} path - 模型路径\r\n * @param {Function} onProgress - 进度回调\r\n * @returns\r\n */\r\n function asyncLoad(path, onProgress) {\r\n return new Promise((resolve, reject) => {\r\n loader.load(path, resolve, onProgress, reject);\r\n });\r\n }\r\n\r\n /**\r\n * Promise 形式异步加载模型并缓存\r\n * 使用IndexDb 对加载后的模型文件进行缓存\r\n * 二次访问时直接从缓存中加载, 减少网络请求\r\n * @param {*} path - 模型路径\r\n * @param {*} onProgress - 进度回调\r\n * @returns { Object3D }\r\n */\r\n async function asyncCacheLoad(path, onProgress) {\r\n if (!idbCache) idbCache = new IDBCache();\r\n const cacheObj = await idbCache.loadCachedModel(path);\r\n if (cacheObj) return cacheObj;\r\n\r\n return new Promise((resolve, reject) => {\r\n loader.load(path, resolve, onProgress, reject);\r\n }).then(async (model) => {\r\n await idbCache.cacheModel(path, model.scene);\r\n return model;\r\n });\r\n }\r\n\r\n return {\r\n load,\r\n asyncLoad,\r\n asyncCacheLoad,\r\n };\r\n};\r\n",
582
+ "static": true,
583
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/useGLTFLoader.js",
584
+ "access": "public",
585
+ "description": null,
586
+ "lineNumber": 1
587
+ },
588
+ {
589
+ "__docId__": 50,
590
+ "kind": "function",
591
+ "name": "useGLTFLoader",
592
+ "memberof": "src/hooks/useGLTFLoader.js",
593
+ "generator": false,
594
+ "async": false,
595
+ "static": true,
596
+ "longname": "src/hooks/useGLTFLoader.js~useGLTFLoader",
597
+ "access": "public",
598
+ "export": true,
599
+ "importPath": "@ridp/threejs/src/hooks/useGLTFLoader.js",
600
+ "importStyle": "{useGLTFLoader}",
601
+ "description": "GLTFLoader 模型加载器",
602
+ "lineNumber": 15,
603
+ "unknown": [
604
+ {
605
+ "tagName": "@returns",
606
+ "tagValue": "{ Object }"
607
+ }
608
+ ],
609
+ "properties": [
610
+ {
611
+ "nullable": null,
612
+ "types": [
613
+ " Function "
614
+ ],
615
+ "spread": false,
616
+ "optional": false,
617
+ "name": "load",
618
+ "description": "模型加载方法"
619
+ },
620
+ {
621
+ "nullable": null,
622
+ "types": [
623
+ " Function "
624
+ ],
625
+ "spread": false,
626
+ "optional": false,
627
+ "name": "asyncLoad",
628
+ "description": "Promise 形式异步加载模型方法"
629
+ },
630
+ {
631
+ "nullable": null,
632
+ "types": [
633
+ " Function "
634
+ ],
635
+ "spread": false,
636
+ "optional": false,
637
+ "name": "asyncCacheLoad",
638
+ "description": "Promise 形式异步加载模型并缓存方法"
639
+ }
640
+ ],
641
+ "return": {
642
+ "nullable": null,
643
+ "types": [
644
+ " Object "
645
+ ],
646
+ "spread": false,
647
+ "description": ""
648
+ },
649
+ "params": []
650
+ },
651
+ {
652
+ "__docId__": 51,
653
+ "kind": "file",
654
+ "name": "src/hooks/useObb.js",
655
+ "content": "import { Color, Box3, Vector3 } from 'three'\r\nimport { OBB } from 'three/addons'\r\n\r\n// 按parentUid存储obb对象, 用于碰撞检测\r\nexport const obbObjects = []\r\nexport const intersectColor = new Color(0xff0000)\r\n\r\nexport const useObb = () => {\r\n const resetObbs = () => {\r\n obbObjects.splice(0)\r\n }\r\n\r\n const initObb = (parentUid, model) => {\r\n model.traverse((child) => {\r\n // 需要碰撞检测的标记\r\n child && initSingleObbItem(parentUid, child)\r\n })\r\n }\r\n\r\n const initSingleObbItem = (parentUid, model) => {\r\n if (model.userData.needCheck) {\r\n model.autoUpdateMatrix = false\r\n model.updateMatrix()\r\n model.updateMatrixWorld()\r\n if (model.isMesh) {\r\n const box3 = new Box3(new Vector3()).setFromObject(model)\r\n\r\n model.geometry.userData.obb = new OBB()\r\n model.geometry.userData.obb.halfSize.copy(box3.getSize(new Vector3())).multiplyScalar(0.5).multiplyScalar(0.88)\r\n model.userData.obb = new OBB()\r\n\r\n model.userData.originColor = model.material.color.clone()\r\n model.userData.parentUid = parentUid\r\n\r\n obbObjects.push({\r\n object: model,\r\n parentUid: parentUid\r\n })\r\n }\r\n }\r\n }\r\n\r\n const addObbFromArray = (parentUid, arr) => {\r\n for (let i = 0, il = arr.length; i < il; i++) {\r\n initSingleObbItem(parentUid, arr[i])\r\n }\r\n }\r\n\r\n const getObbObjectByParentUid = (parentUid) => {\r\n return obbObjects.filter((item) => item.parentUid === parentUid)\r\n }\r\n\r\n const removeObbFromArray = (obbs) => {\r\n const list = obbObjects.filter((item) => !obbs.includes(item.object))\r\n obbObjects.splice(0, obbObjects.length, ...list)\r\n }\r\n\r\n const removeUidObb = (parentUid) => {\r\n for (let i = obbObjects.length - 1; i >= 0; i--) {\r\n if (obbObjects[i].parentUid === parentUid) {\r\n obbObjects.splice(i, 1)\r\n }\r\n }\r\n }\r\n\r\n return {\r\n resetObbs,\r\n initObb,\r\n getObbObjectByParentUid,\r\n addObbFromArray,\r\n removeObbFromArray,\r\n removeUidObb\r\n }\r\n}\r\n",
656
+ "static": true,
657
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/useObb.js",
658
+ "access": "public",
659
+ "description": null,
660
+ "lineNumber": 1
661
+ },
662
+ {
663
+ "__docId__": 52,
664
+ "kind": "variable",
665
+ "name": "obbObjects",
666
+ "memberof": "src/hooks/useObb.js",
667
+ "static": true,
668
+ "longname": "src/hooks/useObb.js~obbObjects",
669
+ "access": "public",
670
+ "export": true,
671
+ "importPath": "@ridp/threejs/src/hooks/useObb.js",
672
+ "importStyle": "{obbObjects}",
673
+ "description": null,
674
+ "lineNumber": 5,
675
+ "undocument": true,
676
+ "type": {
677
+ "types": [
678
+ "*[]"
679
+ ]
680
+ }
681
+ },
682
+ {
683
+ "__docId__": 53,
684
+ "kind": "variable",
685
+ "name": "intersectColor",
686
+ "memberof": "src/hooks/useObb.js",
687
+ "static": true,
688
+ "longname": "src/hooks/useObb.js~intersectColor",
689
+ "access": "public",
690
+ "export": true,
691
+ "importPath": "@ridp/threejs/src/hooks/useObb.js",
692
+ "importStyle": "{intersectColor}",
693
+ "description": null,
694
+ "lineNumber": 6,
695
+ "undocument": true,
696
+ "type": {
697
+ "types": [
698
+ "*"
699
+ ]
700
+ }
701
+ },
702
+ {
703
+ "__docId__": 54,
704
+ "kind": "function",
705
+ "name": "useObb",
706
+ "memberof": "src/hooks/useObb.js",
707
+ "generator": false,
708
+ "async": false,
709
+ "static": true,
710
+ "longname": "src/hooks/useObb.js~useObb",
711
+ "access": "public",
712
+ "export": true,
713
+ "importPath": "@ridp/threejs/src/hooks/useObb.js",
714
+ "importStyle": "{useObb}",
715
+ "description": null,
716
+ "lineNumber": 8,
717
+ "undocument": true,
718
+ "params": [],
719
+ "return": {
720
+ "types": [
721
+ "{\"resetObbs\": *, \"initObb\": *, \"getObbObjectByParentUid\": *, \"addObbFromArray\": *, \"removeObbFromArray\": *, \"removeUidObb\": *}"
722
+ ]
723
+ }
724
+ },
725
+ {
726
+ "__docId__": 55,
727
+ "kind": "file",
728
+ "name": "src/hooks/useRaycaster.js",
729
+ "content": "import { Raycaster, Vector2 } from \"three\";\r\n\r\n// Raycaster\r\nexport const useRaycaster = (appId = \"app\") => {\r\n const raycaster = new Raycaster();\r\n raycaster.params.Line.threshold = 8;\r\n const pointer = new Vector2();\r\n\r\n const $app = document.getElementById(appId);\r\n\r\n /**\r\n * 获取鼠标坐标\r\n * @param {*} event HtmlEvent\r\n * @param {*} container HTMLDomElement\r\n * @returns\r\n */\r\n function getPointer(event, container) {\r\n const { scaleX, scaleY } = getScale($app);\r\n const { clientWidth, clientHeight } = container;\r\n const size = container.getBoundingClientRect();\r\n\r\n const realDomWidth = clientWidth * scaleX;\r\n const realDomHeight = clientHeight * scaleY;\r\n\r\n const x = event.clientX - size.left;\r\n const y = event.clientY - size.top;\r\n pointer.x = ((event.clientX - size.left) / realDomWidth) * 2 - 1;\r\n pointer.y = -((event.clientY - size.top) / realDomHeight) * 2 + 1;\r\n return { pointer, x, y };\r\n }\r\n\r\n /**\r\n * 获取鼠标捕获的对象\r\n * @param {*} event HtmlEvent\r\n * @param {*} renderDom renderer.domElement\r\n * @param {*} camera Camera\r\n * @param {*} catchObjects Objects3D[]\r\n * @returns Objects3D[] || null\r\n */\r\n function getIntersects(event, renderDom, camera, catchObjects) {\r\n const { pointer, x, y } = getPointer(event, renderDom);\r\n raycaster.setFromCamera(pointer, camera);\r\n const intersects = raycaster.intersectObjects(catchObjects);\r\n return { intersects, pointer, x, y };\r\n }\r\n\r\n /**\r\n * 获取 DOM 的缩放比例\r\n * @param {*} element\r\n * @returns\r\n */\r\n function getScale(element) {\r\n const style = window.getComputedStyle(element);\r\n const transform =\r\n style.transform || style.webkitTransform || style.mozTransform;\r\n\r\n if (transform && transform !== \"none\") {\r\n const matrix = transform.match(/^matrix\\((.+)\\)$/);\r\n if (matrix) {\r\n const values = matrix[1].split(\", \");\r\n const scaleX = parseFloat(values[0]);\r\n const scaleY = parseFloat(values[3]);\r\n return { scaleX, scaleY };\r\n }\r\n }\r\n // 如果没有缩放,返回默认值\r\n return { scaleX: 1, scaleY: 1 };\r\n }\r\n\r\n return {\r\n raycaster,\r\n pointer,\r\n\r\n getPointer,\r\n getScale,\r\n getIntersects,\r\n };\r\n};\r\n",
730
+ "static": true,
731
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/useRaycaster.js",
732
+ "access": "public",
733
+ "description": null,
734
+ "lineNumber": 1
735
+ },
736
+ {
737
+ "__docId__": 56,
738
+ "kind": "function",
739
+ "name": "useRaycaster",
740
+ "memberof": "src/hooks/useRaycaster.js",
741
+ "generator": false,
742
+ "async": false,
743
+ "static": true,
744
+ "longname": "src/hooks/useRaycaster.js~useRaycaster",
745
+ "access": "public",
746
+ "export": true,
747
+ "importPath": "@ridp/threejs/src/hooks/useRaycaster.js",
748
+ "importStyle": "{useRaycaster}",
749
+ "description": null,
750
+ "lineNumber": 4,
751
+ "undocument": true,
752
+ "params": [
753
+ {
754
+ "name": "appId",
755
+ "optional": true,
756
+ "types": [
757
+ "string"
758
+ ],
759
+ "defaultRaw": "app",
760
+ "defaultValue": "app"
761
+ }
762
+ ],
763
+ "return": {
764
+ "types": [
765
+ "{\"raycaster\": *, \"pointer\": *, \"getPointer\": *, \"getScale\": *, \"getIntersects\": *}"
766
+ ]
767
+ }
768
+ },
769
+ {
770
+ "__docId__": 57,
771
+ "kind": "file",
772
+ "name": "src/hooks/useThreeJs.js",
773
+ "content": "import {\r\n Scene,\r\n Group,\r\n PerspectiveCamera,\r\n WebGLRenderer,\r\n Color,\r\n Box3,\r\n Vector3,\r\n MathUtils,\r\n} from \"three\";\r\nimport { nextTick, onMounted, onUnmounted, ref, shallowRef } from \"vue\";\r\nimport Stats from \"three/addons/libs/stats.module.js\";\r\nimport { CSS3DRenderer } from \"three/examples/jsm/renderers/CSS3DRenderer.js\";\r\n\r\nimport { createOrbitControl, disposeThreeObject } from \"../utils\";\r\nimport { OrbitControls } from \"three/examples/jsm/Addons.js\";\r\nimport { Object3D } from \"three\";\r\n\r\n// 默认控制器配置\r\nconst defaultControlOpt = {\r\n enableDamping: true,\r\n dampingFactor: 0.25,\r\n screenSpacePanning: false,\r\n minDistance: 0.1,\r\n maxDistance: 1000,\r\n maxPolarAngle: MathUtils.degToRad(60),\r\n};\r\n\r\n/**\r\n * \r\n * @param {String} selector ID '#xxxx'\r\n * @param {Object} option {\r\n * css3d: false,\r\n stats: false,\r\n control: {\r\n init: true,\r\n options: {\r\n ...OrbitControls属性\r\n },\r\n },\r\n * }\r\n * @returns any\r\n */\r\nexport function useThreeJs(selector, option) {\r\n const _option = Object.assign(\r\n {\r\n css3d: false,\r\n stats: false,\r\n control: {\r\n init: true,\r\n options: {},\r\n },\r\n },\r\n option || {}\r\n );\r\n\r\n let el,\r\n stats,\r\n css3dRenderer,\r\n animateCbs = [];\r\n\r\n const isReady = ref(false);\r\n\r\n const control = shallowRef();\r\n const domWidth = ref(0);\r\n const domHeight = ref(0);\r\n\r\n const renderer = new WebGLRenderer({\r\n antialias: true,\r\n alpha: true,\r\n precision: \"mediump\",\r\n logarithmicDepthBuffer: true,\r\n });\r\n const scene = new Scene({});\r\n const camera = new PerspectiveCamera(50, 1, 0.1, 2000);\r\n const tanFOV = Math.tan(((Math.PI / 180) * camera.fov) / 2);\r\n\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n\r\n function init() {\r\n isReady.value = false;\r\n const size = getTargetSize();\r\n domWidth.value = size[0];\r\n domHeight.value = size[1];\r\n\r\n camera.aspect = domWidth.value / domHeight.value;\r\n camera.position.set(47, 39, 100);\r\n camera.fov =\r\n (360 / Math.PI) * Math.atan(tanFOV * (domHeight.value / domWidth.value));\r\n camera.lookAt(0, 0, 0);\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(domWidth.value, domHeight.value);\r\n el.appendChild(renderer.domElement);\r\n\r\n _option.stats && initStats();\r\n // css3d\r\n _option.css3d && createCss3dRenderer();\r\n\r\n // 控制器\r\n let control;\r\n if (_option.control && _option.control.init) {\r\n control = createOrbitControl(camera, renderer.domElement);\r\n const controlOpt = Object.assign(\r\n defaultControlOpt,\r\n _option.control.options || {}\r\n );\r\n Object.keys(controlOpt).forEach((key) => {\r\n control[key] = controlOpt[key];\r\n });\r\n }\r\n\r\n nextTick(() => (isReady.value = true));\r\n return control;\r\n }\r\n\r\n function onContextLost(event) {\r\n event.preventDefault();\r\n cancelAnimationFrame(animate);\r\n }\r\n function onContextRestored(event) {\r\n event.preventDefault();\r\n init();\r\n animate();\r\n }\r\n\r\n /**\r\n * 循环帧中添加执行函数\r\n * @param {*} animate \r\n */\r\n function addAnimate(animate) {\r\n animateCbs.push(animate);\r\n }\r\n\r\n function animate(cbs) {\r\n animateCbs &&\r\n animateCbs.length &&\r\n animateCbs.forEach((fun) => {\r\n typeof fun === \"function\" && fun();\r\n });\r\n\r\n control.value && control.value.update();\r\n renderer.render(scene, camera);\r\n stats && stats.update();\r\n css3dRenderer && css3dRenderer.render(scene, camera);\r\n\r\n requestAnimationFrame(animate);\r\n }\r\n\r\n function onResize() {\r\n nextTick(() => {\r\n const size = getTargetSize();\r\n domWidth.value = size[0];\r\n domHeight.value = size[1];\r\n camera.aspect = domWidth.value / domHeight.value;\r\n // adjust the FOV\r\n camera.fov =\r\n (360 / Math.PI) *\r\n Math.atan(tanFOV * (domHeight.value / domWidth.value));\r\n camera.updateProjectionMatrix();\r\n camera.lookAt(scene.position);\r\n\r\n renderer.render(scene, camera);\r\n renderer.setSize(domWidth.value, domHeight.value);\r\n\r\n css3dRenderer && css3dRenderer.setSize(domWidth.value, domHeight.value);\r\n });\r\n }\r\n\r\n function getTargetSize() {\r\n el = document.querySelector(selector);\r\n return [el.clientWidth, el.clientHeight];\r\n }\r\n\r\n function initStats() {\r\n stats = new Stats();\r\n stats.dom.style.cssText =\r\n \"position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000\";\r\n el.appendChild(stats.dom);\r\n }\r\n\r\n /**物体视窗自动适应\r\n *\r\n * @param {Object3D} model\r\n * @param {Number} scale\r\n * @param {Camera} camera\r\n * @param {OrbitControls} controls\r\n * @param {Vector3} offset\r\n */\r\n function frameArea(model, scale, camera, controls, offset) {\r\n const box = new Box3().setFromObject(model);\r\n const boxSize = box.getSize(new Vector3()).length();\r\n const boxCenter = box.getCenter(new Vector3());\r\n\r\n if (offset) boxCenter.add(offset);\r\n\r\n const sizeToFitOnScreen = boxSize * scale;\r\n const halfSizeToFitOnScreen = sizeToFitOnScreen * 0.5;\r\n const halfFovY = MathUtils.degToRad(camera.fov * 0.5);\r\n const distance = halfSizeToFitOnScreen / Math.tan(halfFovY);\r\n const direction = new Vector3()\r\n .subVectors(camera.position, boxCenter)\r\n .multiply(new Vector3(1, 1, 1))\r\n .normalize();\r\n\r\n const neP = direction.multiplyScalar(distance).add(boxCenter);\r\n const targetOption = {\r\n x: neP.x,\r\n y: neP.y,\r\n z: neP.z,\r\n lookAt_x: boxCenter.x,\r\n lookAt_y: boxCenter.y,\r\n lookAt_z: boxCenter.z,\r\n };\r\n\r\n camera.position.set(targetOption.x, targetOption.y, targetOption.z);\r\n camera.lookAt(\r\n targetOption.lookAt_x,\r\n targetOption.lookAt_y,\r\n targetOption.lookAt_z\r\n );\r\n camera.updateProjectionMatrix();\r\n controls.target.copy(boxCenter);\r\n controls.update();\r\n return boxSize;\r\n }\r\n\r\n function createCss3dRenderer() {\r\n css3dRenderer = new CSS3DRenderer();\r\n css3dRenderer.setSize(domWidth.value, domHeight.value);\r\n css3dRenderer.domElement.style.position = \"absolute\";\r\n css3dRenderer.domElement.style.top = 0;\r\n css3dRenderer.domElement.style.left = 0;\r\n css3dRenderer.domElement.style.pointerEvents = \"none\";\r\n el.appendChild(css3dRenderer.domElement);\r\n }\r\n\r\n function dispose() {\r\n disposeThreeObject(scene);\r\n }\r\n\r\n onMounted(() => {\r\n control.value = init();\r\n\r\n renderer.domElement.addEventListener(\"resize\", onResize, false);\r\n renderer.domElement.addEventListener(\r\n \"webglcontextlost\",\r\n onContextLost,\r\n false\r\n );\r\n renderer.domElement.addEventListener(\r\n \"webglcontextrestored\",\r\n onContextRestored,\r\n false\r\n );\r\n requestAnimationFrame(animate);\r\n });\r\n\r\n onUnmounted(() => {\r\n cancelAnimationFrame(animate);\r\n renderer.domElement.removeEventListener(\"resize\", onResize, false);\r\n renderer.domElement.removeEventListener(\r\n \"webglcontextlost\",\r\n onContextLost,\r\n false\r\n );\r\n renderer.domElement.removeEventListener(\r\n \"webglcontextrestored\",\r\n onContextRestored,\r\n false\r\n );\r\n dispose();\r\n });\r\n\r\n return {\r\n addAnimate,\r\n frameArea,\r\n\r\n scene,\r\n camera,\r\n control,\r\n renderer,\r\n domWidth,\r\n domHeight,\r\n isReady,\r\n };\r\n}\r\n",
774
+ "static": true,
775
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/hooks/useThreeJs.js",
776
+ "access": "public",
777
+ "description": null,
778
+ "lineNumber": 1
779
+ },
780
+ {
781
+ "__docId__": 58,
782
+ "kind": "variable",
783
+ "name": "defaultControlOpt",
784
+ "memberof": "src/hooks/useThreeJs.js",
785
+ "static": true,
786
+ "longname": "src/hooks/useThreeJs.js~defaultControlOpt",
787
+ "access": "public",
788
+ "export": false,
789
+ "importPath": "@ridp/threejs/src/hooks/useThreeJs.js",
790
+ "importStyle": null,
791
+ "description": null,
792
+ "lineNumber": 20,
793
+ "undocument": true,
794
+ "type": {
795
+ "types": [
796
+ "{\"enableDamping\": boolean, \"dampingFactor\": number, \"screenSpacePanning\": *, \"minDistance\": number, \"maxDistance\": number, \"maxPolarAngle\": *}"
797
+ ]
798
+ },
799
+ "ignore": true
800
+ },
801
+ {
802
+ "__docId__": 59,
803
+ "kind": "function",
804
+ "name": "useThreeJs",
805
+ "memberof": "src/hooks/useThreeJs.js",
806
+ "generator": false,
807
+ "async": false,
808
+ "static": true,
809
+ "longname": "src/hooks/useThreeJs.js~useThreeJs",
810
+ "access": "public",
811
+ "export": true,
812
+ "importPath": "@ridp/threejs/src/hooks/useThreeJs.js",
813
+ "importStyle": "{useThreeJs}",
814
+ "description": "",
815
+ "lineNumber": 44,
816
+ "unknown": [
817
+ {
818
+ "tagName": "@returns",
819
+ "tagValue": "any"
820
+ }
821
+ ],
822
+ "params": [
823
+ {
824
+ "nullable": null,
825
+ "types": [
826
+ "String"
827
+ ],
828
+ "spread": false,
829
+ "optional": false,
830
+ "name": "selector",
831
+ "description": "ID '#xxxx'"
832
+ },
833
+ {
834
+ "nullable": null,
835
+ "types": [
836
+ "Object"
837
+ ],
838
+ "spread": false,
839
+ "optional": false,
840
+ "name": "option",
841
+ "description": "{\n css3d: false,\nstats: false,\ncontrol: {\ninit: true,\noptions: {\n...OrbitControls属性\n},\n},\n}"
842
+ }
843
+ ],
844
+ "return": {
845
+ "nullable": null,
846
+ "types": [
847
+ "*"
848
+ ],
849
+ "spread": false,
850
+ "description": "any"
851
+ }
852
+ },
853
+ {
854
+ "__docId__": 60,
855
+ "kind": "file",
856
+ "name": "src/index.js",
857
+ "content": "export * from \"./hooks\";\r\nexport * from \"./utils\";\r\nexport * from \"./instance\";\r\n",
858
+ "static": true,
859
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/index.js",
860
+ "access": "public",
861
+ "description": null,
862
+ "lineNumber": 1
863
+ },
864
+ {
865
+ "__docId__": 61,
866
+ "kind": "file",
867
+ "name": "src/instance/IDBCache.js",
868
+ "content": "import * as THREE from \"three\";\r\nimport Dexie from \"dexie\";\r\n\r\n/**\r\n * ThreeJS 缓存工具类\r\n */\r\nexport class IDBCache {\r\n /**\r\n * 构造函数\r\n * @param {string} dbName - 数据库名称\r\n * @param {Object} tableDefinitions - 表定义对象,例如 { models: \"&path, data\" }\r\n * @param {number} version - 数据库版本号\r\n */\r\n constructor(dbName = \"threeJsIDBCache\", version = 1) {\r\n this.db = new Dexie(dbName);\r\n this.materialMap = {};\r\n\r\n // 初始化数据库版本和表\r\n this.db.version(version).stores({ models: \"&path, data\" });\r\n }\r\n\r\n /**\r\n * 获取 Dexie 数据库实例\r\n * @returns {Dexie} Dexie 实例\r\n */\r\n getDatabase() {\r\n return this.db;\r\n }\r\n\r\n /**\r\n * 序列化 Three.js 对象\r\n * @param {THREE.Object3D} object - 要序列化的对象\r\n * @returns {Object} 序列化后的数据\r\n */\r\n serObject3D(object) {\r\n const serialized = {\r\n type: object.type,\r\n name: object.name,\r\n position: object.position.toArray(),\r\n rotation: object.rotation.toArray(),\r\n scale: object.scale.toArray(),\r\n visible: object.visible,\r\n children: [],\r\n geometry: null,\r\n material: null,\r\n };\r\n\r\n if (object.isMesh) {\r\n serialized.geometry = this.serGeometry(object.geometry);\r\n serialized.material = this.serMaterial(object.material);\r\n }\r\n\r\n for (const child of object.children) {\r\n serialized.children.push(this.serObject3D(child));\r\n }\r\n\r\n return serialized;\r\n }\r\n\r\n /**\r\n * 序列化几何体\r\n * @param {THREE.BufferGeometry} geometry - 几何体\r\n * @returns {Object} 序列化后的几何体数据\r\n */\r\n serGeometry(geometry) {\r\n const _attributes = [];\r\n const { attributes, index, type } = geometry;\r\n\r\n if (attributes.position)\r\n _attributes[\"position\"] = {\r\n type: \"Float32Array\",\r\n array: Array.from(attributes.position.array),\r\n itemSize: 3,\r\n };\r\n if (attributes.normal)\r\n _attributes[\"normal\"] = {\r\n type: \"Float32Array\",\r\n array: Array.from(attributes.normal.array),\r\n itemSize: 3,\r\n };\r\n if (attributes.uv)\r\n _attributes[\"uv\"] = {\r\n type: \"Float32Array\",\r\n array: Array.from(attributes.uv.array),\r\n itemSize: 2,\r\n };\r\n\r\n const result = {\r\n type: type,\r\n attributes: _attributes,\r\n };\r\n\r\n if (index && index.array) {\r\n result[\"index\"] = {\r\n type: \"Uint32Array\",\r\n array: Array.from(index.array),\r\n itemSize: 1,\r\n };\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * 反序列化几何体\r\n * @param {Object} data - 序列化后的几何体数据\r\n * @returns {THREE.BufferGeometry} 反序列化后的几何体\r\n */\r\n reSerGeometry(data) {\r\n const { type, attributes, index } = data;\r\n const geometry = new THREE.BufferGeometry();\r\n Object.keys(attributes).forEach((key) => {\r\n const { type, array, itemSize } = attributes[key];\r\n geometry.setAttribute(\r\n key,\r\n new THREE.BufferAttribute(new Float32Array(array), itemSize)\r\n );\r\n });\r\n\r\n if (index) {\r\n geometry.setIndex(index.array);\r\n }\r\n return geometry;\r\n }\r\n\r\n /**\r\n * 序列化材质\r\n * @param {THREE.Material} material - 材质\r\n * @returns {Object} 序列化后的材质数据\r\n */\r\n serMaterial(material) {\r\n return {\r\n type: material.type,\r\n color: material.color.getHex(),\r\n map: material.map ? material.map.image.src : null,\r\n opacity: material.opacity,\r\n name: material.name,\r\n depthTest: material.depthTest,\r\n depthWrite: material.depthWrite,\r\n transparent: material.transparent,\r\n side: material.side,\r\n roughness: material.roughness,\r\n metalness: material.metalness,\r\n emissive: material.emissive.getHex(),\r\n };\r\n }\r\n\r\n /**\r\n * 反序列化材质\r\n * @param {Object} data - 序列化后的材质数据\r\n * @returns {THREE.Material} 反序列化后的材质\r\n */\r\n reSerMaterial(data) {\r\n // 同名材质复用\r\n if (this.materialMap[data.name]) return this.materialMap[data.name];\r\n const { type, ...rest } = data;\r\n\r\n const materialType = type || \"MeshStandardMaterial\";\r\n const material = new THREE[materialType]({ ...rest });\r\n if (data.map) {\r\n const texture = new THREE.TextureLoader().load(data.map);\r\n material.map = texture;\r\n }\r\n material.needsUpdate = true;\r\n\r\n this.materialMap[data.name] = material;\r\n return material;\r\n }\r\n\r\n /**\r\n * 反序列化 Three.js 对象\r\n * @param {Object} data - 序列化后的数据\r\n * @returns {THREE.Object3D} 反序列化后的对象\r\n */\r\n reSerObject3D(data) {\r\n let object;\r\n\r\n switch (data.type) {\r\n case \"Mesh\":\r\n const geometry = this.reSerGeometry(data.geometry);\r\n const material = this.reSerMaterial(data.material);\r\n object = new THREE.Mesh(geometry, material);\r\n break;\r\n case \"Group\":\r\n object = new THREE.Group();\r\n break;\r\n case \"Object3D\":\r\n object = new THREE.Object3D();\r\n break;\r\n default:\r\n console.warn(`Unsupported object type: ${data.type}`);\r\n return null;\r\n }\r\n\r\n object.name = data.name;\r\n object.position.fromArray(data.position);\r\n object.rotation.fromArray(data.rotation);\r\n object.scale.fromArray(data.scale);\r\n object.visible = data.visible;\r\n\r\n for (const childData of data.children) {\r\n const child = this.reSerObject3D(childData);\r\n if (child) {\r\n object.add(child);\r\n }\r\n }\r\n\r\n return object;\r\n }\r\n\r\n /**\r\n * 缓存模型到 IndexedDB\r\n * @param {string} path - 主键值\r\n * @param {THREE.Object3D} model - 要缓存的模型\r\n */\r\n async cacheModel(path, model) {\r\n const serializedData = this.serObject3D(model);\r\n await this.db.table(\"models\").put({ path, data: serializedData });\r\n console.log(`Model \"${path}\" cached successfully in table models`);\r\n }\r\n\r\n /**\r\n * 从 IndexedDB 加载缓存的模型\r\n * @param {string} path - 主键值\r\n * @returns {THREE.Object3D | null} 加载的模型\r\n */\r\n async loadCachedModel(path) {\r\n const record = await this.db.table(\"models\").get(path);\r\n if (!record) {\r\n console.warn(`Model \"${path}\" not found in table models`);\r\n return null;\r\n }\r\n const deserializedModel = this.reSerObject3D(record.data);\r\n console.log(`Model \"${path}\" loaded from table models`);\r\n return deserializedModel;\r\n }\r\n}\r\n",
869
+ "static": true,
870
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/instance/IDBCache.js",
871
+ "access": "public",
872
+ "description": null,
873
+ "lineNumber": 1
874
+ },
875
+ {
876
+ "__docId__": 62,
877
+ "kind": "class",
878
+ "name": "IDBCache",
879
+ "memberof": "src/instance/IDBCache.js",
880
+ "static": true,
881
+ "longname": "src/instance/IDBCache.js~IDBCache",
882
+ "access": "public",
883
+ "export": true,
884
+ "importPath": "@ridp/threejs/src/instance/IDBCache.js",
885
+ "importStyle": "{IDBCache}",
886
+ "description": "ThreeJS 缓存工具类",
887
+ "lineNumber": 7,
888
+ "interface": false
889
+ },
890
+ {
891
+ "__docId__": 63,
892
+ "kind": "constructor",
893
+ "name": "constructor",
894
+ "memberof": "src/instance/IDBCache.js~IDBCache",
895
+ "generator": false,
896
+ "async": false,
897
+ "static": false,
898
+ "longname": "src/instance/IDBCache.js~IDBCache#constructor",
899
+ "access": "public",
900
+ "description": "构造函数",
901
+ "lineNumber": 14,
902
+ "params": [
903
+ {
904
+ "nullable": null,
905
+ "types": [
906
+ "string"
907
+ ],
908
+ "spread": false,
909
+ "optional": false,
910
+ "name": "dbName",
911
+ "description": "数据库名称"
912
+ },
913
+ {
914
+ "nullable": null,
915
+ "types": [
916
+ "Object"
917
+ ],
918
+ "spread": false,
919
+ "optional": false,
920
+ "name": "tableDefinitions",
921
+ "description": "表定义对象,例如 { models: \"&path, data\" }"
922
+ },
923
+ {
924
+ "nullable": null,
925
+ "types": [
926
+ "number"
927
+ ],
928
+ "spread": false,
929
+ "optional": false,
930
+ "name": "version",
931
+ "description": "数据库版本号"
932
+ }
933
+ ]
934
+ },
935
+ {
936
+ "__docId__": 64,
937
+ "kind": "member",
938
+ "name": "db",
939
+ "memberof": "src/instance/IDBCache.js~IDBCache",
940
+ "static": false,
941
+ "longname": "src/instance/IDBCache.js~IDBCache#db",
942
+ "access": "public",
943
+ "description": null,
944
+ "lineNumber": 15,
945
+ "undocument": true,
946
+ "type": {
947
+ "types": [
948
+ "*"
949
+ ]
950
+ }
951
+ },
952
+ {
953
+ "__docId__": 65,
954
+ "kind": "member",
955
+ "name": "materialMap",
956
+ "memberof": "src/instance/IDBCache.js~IDBCache",
957
+ "static": false,
958
+ "longname": "src/instance/IDBCache.js~IDBCache#materialMap",
959
+ "access": "public",
960
+ "description": null,
961
+ "lineNumber": 16,
962
+ "undocument": true,
963
+ "type": {
964
+ "types": [
965
+ "{}"
966
+ ]
967
+ }
968
+ },
969
+ {
970
+ "__docId__": 66,
971
+ "kind": "method",
972
+ "name": "getDatabase",
973
+ "memberof": "src/instance/IDBCache.js~IDBCache",
974
+ "generator": false,
975
+ "async": false,
976
+ "static": false,
977
+ "longname": "src/instance/IDBCache.js~IDBCache#getDatabase",
978
+ "access": "public",
979
+ "description": "获取 Dexie 数据库实例",
980
+ "lineNumber": 26,
981
+ "unknown": [
982
+ {
983
+ "tagName": "@returns",
984
+ "tagValue": "{Dexie} Dexie 实例"
985
+ }
986
+ ],
987
+ "return": {
988
+ "nullable": null,
989
+ "types": [
990
+ "Dexie"
991
+ ],
992
+ "spread": false,
993
+ "description": "Dexie 实例"
994
+ },
995
+ "params": []
996
+ },
997
+ {
998
+ "__docId__": 67,
999
+ "kind": "method",
1000
+ "name": "serObject3D",
1001
+ "memberof": "src/instance/IDBCache.js~IDBCache",
1002
+ "generator": false,
1003
+ "async": false,
1004
+ "static": false,
1005
+ "longname": "src/instance/IDBCache.js~IDBCache#serObject3D",
1006
+ "access": "public",
1007
+ "description": "序列化 Three.js 对象",
1008
+ "lineNumber": 35,
1009
+ "unknown": [
1010
+ {
1011
+ "tagName": "@returns",
1012
+ "tagValue": "{Object} 序列化后的数据"
1013
+ }
1014
+ ],
1015
+ "params": [
1016
+ {
1017
+ "nullable": null,
1018
+ "types": [
1019
+ "THREE.Object3D"
1020
+ ],
1021
+ "spread": false,
1022
+ "optional": false,
1023
+ "name": "object",
1024
+ "description": "要序列化的对象"
1025
+ }
1026
+ ],
1027
+ "return": {
1028
+ "nullable": null,
1029
+ "types": [
1030
+ "Object"
1031
+ ],
1032
+ "spread": false,
1033
+ "description": "序列化后的数据"
1034
+ }
1035
+ },
1036
+ {
1037
+ "__docId__": 68,
1038
+ "kind": "method",
1039
+ "name": "serGeometry",
1040
+ "memberof": "src/instance/IDBCache.js~IDBCache",
1041
+ "generator": false,
1042
+ "async": false,
1043
+ "static": false,
1044
+ "longname": "src/instance/IDBCache.js~IDBCache#serGeometry",
1045
+ "access": "public",
1046
+ "description": "序列化几何体",
1047
+ "lineNumber": 65,
1048
+ "unknown": [
1049
+ {
1050
+ "tagName": "@returns",
1051
+ "tagValue": "{Object} 序列化后的几何体数据"
1052
+ }
1053
+ ],
1054
+ "params": [
1055
+ {
1056
+ "nullable": null,
1057
+ "types": [
1058
+ "THREE.BufferGeometry"
1059
+ ],
1060
+ "spread": false,
1061
+ "optional": false,
1062
+ "name": "geometry",
1063
+ "description": "几何体"
1064
+ }
1065
+ ],
1066
+ "return": {
1067
+ "nullable": null,
1068
+ "types": [
1069
+ "Object"
1070
+ ],
1071
+ "spread": false,
1072
+ "description": "序列化后的几何体数据"
1073
+ }
1074
+ },
1075
+ {
1076
+ "__docId__": 69,
1077
+ "kind": "method",
1078
+ "name": "reSerGeometry",
1079
+ "memberof": "src/instance/IDBCache.js~IDBCache",
1080
+ "generator": false,
1081
+ "async": false,
1082
+ "static": false,
1083
+ "longname": "src/instance/IDBCache.js~IDBCache#reSerGeometry",
1084
+ "access": "public",
1085
+ "description": "反序列化几何体",
1086
+ "lineNumber": 109,
1087
+ "unknown": [
1088
+ {
1089
+ "tagName": "@returns",
1090
+ "tagValue": "{THREE.BufferGeometry} 反序列化后的几何体"
1091
+ }
1092
+ ],
1093
+ "params": [
1094
+ {
1095
+ "nullable": null,
1096
+ "types": [
1097
+ "Object"
1098
+ ],
1099
+ "spread": false,
1100
+ "optional": false,
1101
+ "name": "data",
1102
+ "description": "序列化后的几何体数据"
1103
+ }
1104
+ ],
1105
+ "return": {
1106
+ "nullable": null,
1107
+ "types": [
1108
+ "THREE.BufferGeometry"
1109
+ ],
1110
+ "spread": false,
1111
+ "description": "反序列化后的几何体"
1112
+ }
1113
+ },
1114
+ {
1115
+ "__docId__": 70,
1116
+ "kind": "method",
1117
+ "name": "serMaterial",
1118
+ "memberof": "src/instance/IDBCache.js~IDBCache",
1119
+ "generator": false,
1120
+ "async": false,
1121
+ "static": false,
1122
+ "longname": "src/instance/IDBCache.js~IDBCache#serMaterial",
1123
+ "access": "public",
1124
+ "description": "序列化材质",
1125
+ "lineNumber": 131,
1126
+ "unknown": [
1127
+ {
1128
+ "tagName": "@returns",
1129
+ "tagValue": "{Object} 序列化后的材质数据"
1130
+ }
1131
+ ],
1132
+ "params": [
1133
+ {
1134
+ "nullable": null,
1135
+ "types": [
1136
+ "THREE.Material"
1137
+ ],
1138
+ "spread": false,
1139
+ "optional": false,
1140
+ "name": "material",
1141
+ "description": "材质"
1142
+ }
1143
+ ],
1144
+ "return": {
1145
+ "nullable": null,
1146
+ "types": [
1147
+ "Object"
1148
+ ],
1149
+ "spread": false,
1150
+ "description": "序列化后的材质数据"
1151
+ }
1152
+ },
1153
+ {
1154
+ "__docId__": 71,
1155
+ "kind": "method",
1156
+ "name": "reSerMaterial",
1157
+ "memberof": "src/instance/IDBCache.js~IDBCache",
1158
+ "generator": false,
1159
+ "async": false,
1160
+ "static": false,
1161
+ "longname": "src/instance/IDBCache.js~IDBCache#reSerMaterial",
1162
+ "access": "public",
1163
+ "description": "反序列化材质",
1164
+ "lineNumber": 153,
1165
+ "unknown": [
1166
+ {
1167
+ "tagName": "@returns",
1168
+ "tagValue": "{THREE.Material} 反序列化后的材质"
1169
+ }
1170
+ ],
1171
+ "params": [
1172
+ {
1173
+ "nullable": null,
1174
+ "types": [
1175
+ "Object"
1176
+ ],
1177
+ "spread": false,
1178
+ "optional": false,
1179
+ "name": "data",
1180
+ "description": "序列化后的材质数据"
1181
+ }
1182
+ ],
1183
+ "return": {
1184
+ "nullable": null,
1185
+ "types": [
1186
+ "THREE.Material"
1187
+ ],
1188
+ "spread": false,
1189
+ "description": "反序列化后的材质"
1190
+ }
1191
+ },
1192
+ {
1193
+ "__docId__": 72,
1194
+ "kind": "method",
1195
+ "name": "reSerObject3D",
1196
+ "memberof": "src/instance/IDBCache.js~IDBCache",
1197
+ "generator": false,
1198
+ "async": false,
1199
+ "static": false,
1200
+ "longname": "src/instance/IDBCache.js~IDBCache#reSerObject3D",
1201
+ "access": "public",
1202
+ "description": "反序列化 Three.js 对象",
1203
+ "lineNumber": 175,
1204
+ "unknown": [
1205
+ {
1206
+ "tagName": "@returns",
1207
+ "tagValue": "{THREE.Object3D} 反序列化后的对象"
1208
+ }
1209
+ ],
1210
+ "params": [
1211
+ {
1212
+ "nullable": null,
1213
+ "types": [
1214
+ "Object"
1215
+ ],
1216
+ "spread": false,
1217
+ "optional": false,
1218
+ "name": "data",
1219
+ "description": "序列化后的数据"
1220
+ }
1221
+ ],
1222
+ "return": {
1223
+ "nullable": null,
1224
+ "types": [
1225
+ "THREE.Object3D"
1226
+ ],
1227
+ "spread": false,
1228
+ "description": "反序列化后的对象"
1229
+ }
1230
+ },
1231
+ {
1232
+ "__docId__": 73,
1233
+ "kind": "method",
1234
+ "name": "cacheModel",
1235
+ "memberof": "src/instance/IDBCache.js~IDBCache",
1236
+ "generator": false,
1237
+ "async": true,
1238
+ "static": false,
1239
+ "longname": "src/instance/IDBCache.js~IDBCache#cacheModel",
1240
+ "access": "public",
1241
+ "description": "缓存模型到 IndexedDB",
1242
+ "lineNumber": 216,
1243
+ "params": [
1244
+ {
1245
+ "nullable": null,
1246
+ "types": [
1247
+ "string"
1248
+ ],
1249
+ "spread": false,
1250
+ "optional": false,
1251
+ "name": "path",
1252
+ "description": "主键值"
1253
+ },
1254
+ {
1255
+ "nullable": null,
1256
+ "types": [
1257
+ "THREE.Object3D"
1258
+ ],
1259
+ "spread": false,
1260
+ "optional": false,
1261
+ "name": "model",
1262
+ "description": "要缓存的模型"
1263
+ }
1264
+ ],
1265
+ "return": null
1266
+ },
1267
+ {
1268
+ "__docId__": 74,
1269
+ "kind": "method",
1270
+ "name": "loadCachedModel",
1271
+ "memberof": "src/instance/IDBCache.js~IDBCache",
1272
+ "generator": false,
1273
+ "async": true,
1274
+ "static": false,
1275
+ "longname": "src/instance/IDBCache.js~IDBCache#loadCachedModel",
1276
+ "access": "public",
1277
+ "description": "从 IndexedDB 加载缓存的模型",
1278
+ "lineNumber": 227,
1279
+ "unknown": [
1280
+ {
1281
+ "tagName": "@returns",
1282
+ "tagValue": "{THREE.Object3D | null} 加载的模型"
1283
+ }
1284
+ ],
1285
+ "params": [
1286
+ {
1287
+ "nullable": null,
1288
+ "types": [
1289
+ "string"
1290
+ ],
1291
+ "spread": false,
1292
+ "optional": false,
1293
+ "name": "path",
1294
+ "description": "主键值"
1295
+ }
1296
+ ],
1297
+ "return": {
1298
+ "nullable": null,
1299
+ "types": [
1300
+ "THREE.Object3D ",
1301
+ " null"
1302
+ ],
1303
+ "spread": false,
1304
+ "description": "加载的模型"
1305
+ }
1306
+ },
1307
+ {
1308
+ "__docId__": 75,
1309
+ "kind": "file",
1310
+ "name": "src/instance/index.js",
1311
+ "content": "export * from \"./IDBCache\";\r\n",
1312
+ "static": true,
1313
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/instance/index.js",
1314
+ "access": "public",
1315
+ "description": null,
1316
+ "lineNumber": 1
1317
+ },
1318
+ {
1319
+ "__docId__": 76,
1320
+ "kind": "file",
1321
+ "name": "src/utils/common.js",
1322
+ "content": "export const getCommonParent = (meshList, objectGroup) => {\r\n const parentCount = {};\r\n\r\n meshList.forEach((mesh) => {\r\n let parent = mesh.parent;\r\n while (parent) {\r\n if (parentCount[parent.uuid]) {\r\n parentCount[parent.uuid]++;\r\n } else {\r\n parentCount[parent.uuid] = 1;\r\n }\r\n parent = parent.parent;\r\n }\r\n });\r\n\r\n let commonParent = null;\r\n let maxCount = 0;\r\n\r\n for (const uuid in parentCount) {\r\n if (parentCount[uuid] > maxCount) {\r\n maxCount = parentCount[uuid];\r\n commonParent = objectGroup.getObjectByProperty(\"uuid\", uuid);\r\n }\r\n }\r\n\r\n return commonParent;\r\n};\r\n",
1323
+ "static": true,
1324
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/common.js",
1325
+ "access": "public",
1326
+ "description": null,
1327
+ "lineNumber": 1
1328
+ },
1329
+ {
1330
+ "__docId__": 77,
1331
+ "kind": "function",
1332
+ "name": "getCommonParent",
1333
+ "memberof": "src/utils/common.js",
1334
+ "generator": false,
1335
+ "async": false,
1336
+ "static": true,
1337
+ "longname": "src/utils/common.js~getCommonParent",
1338
+ "access": "public",
1339
+ "export": true,
1340
+ "importPath": "@ridp/threejs/src/utils/common.js",
1341
+ "importStyle": "{getCommonParent}",
1342
+ "description": null,
1343
+ "lineNumber": 1,
1344
+ "undocument": true,
1345
+ "params": [
1346
+ {
1347
+ "name": "meshList",
1348
+ "types": [
1349
+ "*"
1350
+ ]
1351
+ },
1352
+ {
1353
+ "name": "objectGroup",
1354
+ "types": [
1355
+ "*"
1356
+ ]
1357
+ }
1358
+ ],
1359
+ "return": {
1360
+ "types": [
1361
+ "*"
1362
+ ]
1363
+ }
1364
+ },
1365
+ {
1366
+ "__docId__": 78,
1367
+ "kind": "file",
1368
+ "name": "src/utils/css3dHelper.js",
1369
+ "content": "import { CSS3DSprite } from \"three/examples/jsm/Addons.js\";\r\n\r\n/**\r\n * 创建 CSS3DSprite 信息面板\r\n * @param { string } id 元素ID\r\n * @param { [ number, number, number ]} scale 缩放\r\n * @returns new CSS3DSprite()\r\n *\r\n * 注意: html元素不能设置模板为结对定位!!!\r\n */\r\nexport function createInfoPlane(id, scale = [0.3, 0.3, 0.3]) {\r\n const el = document.querySelector(`#${id}`);\r\n if (!el) {\r\n console.log(\" 获取 infoPlane 元素失败 (id) =====> :\", id);\r\n return;\r\n }\r\n const _el = el.cloneNode(true);\r\n _el.style.display = \"block\";\r\n\r\n const plane = new CSS3DSprite(_el);\r\n plane.visible = false;\r\n plane.scale.set(...scale);\r\n return plane;\r\n}\r\nexport function createTagPlane(text, scale) {\r\n const el = tagBlock(text);\r\n el.style.display = \"block\";\r\n const plane = new CSS3DSprite(el);\r\n plane.visible = false;\r\n plane.scale.set(scale, scale, scale);\r\n return plane;\r\n}\r\n\r\nconst tagBlock = (text) => {\r\n const el = document.createElement(\"div\");\r\n el.style.cssText = `\r\n border-radius: 50px;\r\n border: 2px solid rgba(255, 255, 255, 0.5);\r\n background-color: rgba(15, 20, 22, 0.562);\r\n justify-content: flex-start;\r\n align-items: center;\r\n padding: 20px 30px;\r\n display: flex;\r\n transform-origin: center 0;`;\r\n const textSpan = document.createElement(\"span\");\r\n textSpan.style.cssText = `\r\n font-size: 40px;\r\n line-height: 1;\r\n white-space: nowrap;\r\n color: #fff;\r\n font-weight: 700;\r\n `;\r\n textSpan.innerText = text;\r\n el.appendChild(textSpan);\r\n return el;\r\n};\r\n",
1370
+ "static": true,
1371
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/css3dHelper.js",
1372
+ "access": "public",
1373
+ "description": null,
1374
+ "lineNumber": 1
1375
+ },
1376
+ {
1377
+ "__docId__": 79,
1378
+ "kind": "function",
1379
+ "name": "createInfoPlane",
1380
+ "memberof": "src/utils/css3dHelper.js",
1381
+ "generator": false,
1382
+ "async": false,
1383
+ "static": true,
1384
+ "longname": "src/utils/css3dHelper.js~createInfoPlane",
1385
+ "access": "public",
1386
+ "export": true,
1387
+ "importPath": "@ridp/threejs/src/utils/css3dHelper.js",
1388
+ "importStyle": "{createInfoPlane}",
1389
+ "description": "创建 CSS3DSprite 信息面板",
1390
+ "lineNumber": 11,
1391
+ "unknown": [
1392
+ {
1393
+ "tagName": "@returns",
1394
+ "tagValue": "new CSS3DSprite()\n\n注意: html元素不能设置模板为结对定位!!!"
1395
+ }
1396
+ ],
1397
+ "params": [
1398
+ {
1399
+ "nullable": null,
1400
+ "types": [
1401
+ " string "
1402
+ ],
1403
+ "spread": false,
1404
+ "optional": false,
1405
+ "name": "id",
1406
+ "description": "元素ID"
1407
+ },
1408
+ {
1409
+ "nullable": null,
1410
+ "types": [
1411
+ " [ number, number, number ]"
1412
+ ],
1413
+ "spread": false,
1414
+ "optional": false,
1415
+ "name": "scale",
1416
+ "description": "缩放"
1417
+ }
1418
+ ],
1419
+ "return": {
1420
+ "nullable": null,
1421
+ "types": [
1422
+ "*"
1423
+ ],
1424
+ "spread": false,
1425
+ "description": "new CSS3DSprite()\n\n注意: html元素不能设置模板为结对定位!!!"
1426
+ }
1427
+ },
1428
+ {
1429
+ "__docId__": 80,
1430
+ "kind": "function",
1431
+ "name": "createTagPlane",
1432
+ "memberof": "src/utils/css3dHelper.js",
1433
+ "generator": false,
1434
+ "async": false,
1435
+ "static": true,
1436
+ "longname": "src/utils/css3dHelper.js~createTagPlane",
1437
+ "access": "public",
1438
+ "export": true,
1439
+ "importPath": "@ridp/threejs/src/utils/css3dHelper.js",
1440
+ "importStyle": "{createTagPlane}",
1441
+ "description": null,
1442
+ "lineNumber": 25,
1443
+ "undocument": true,
1444
+ "params": [
1445
+ {
1446
+ "name": "text",
1447
+ "types": [
1448
+ "*"
1449
+ ]
1450
+ },
1451
+ {
1452
+ "name": "scale",
1453
+ "types": [
1454
+ "*"
1455
+ ]
1456
+ }
1457
+ ],
1458
+ "return": {
1459
+ "types": [
1460
+ "*"
1461
+ ]
1462
+ }
1463
+ },
1464
+ {
1465
+ "__docId__": 81,
1466
+ "kind": "function",
1467
+ "name": "tagBlock",
1468
+ "memberof": "src/utils/css3dHelper.js",
1469
+ "generator": false,
1470
+ "async": false,
1471
+ "static": true,
1472
+ "longname": "src/utils/css3dHelper.js~tagBlock",
1473
+ "access": "public",
1474
+ "export": false,
1475
+ "importPath": "@ridp/threejs/src/utils/css3dHelper.js",
1476
+ "importStyle": null,
1477
+ "description": null,
1478
+ "lineNumber": 34,
1479
+ "undocument": true,
1480
+ "params": [
1481
+ {
1482
+ "name": "text",
1483
+ "types": [
1484
+ "*"
1485
+ ]
1486
+ }
1487
+ ],
1488
+ "return": {
1489
+ "types": [
1490
+ "*"
1491
+ ]
1492
+ },
1493
+ "ignore": true
1494
+ },
1495
+ {
1496
+ "__docId__": 82,
1497
+ "kind": "file",
1498
+ "name": "src/utils/disposeObject.js",
1499
+ "content": "/**\r\n * 递归释放THREE.js对象 / 材质\r\n * @param { Object3D } object\r\n */\r\nexport const disposeThreeObject = (object) => {\r\n if (object.geometry) {\r\n object.geometry.dispose();\r\n }\r\n\r\n if (object.material) {\r\n // 如果材质是一个数组(例如多材质对象),需要遍历数组并释放每个材质\r\n if (Array.isArray(object.material)) {\r\n object.material.forEach((material) => {\r\n disposeMaterial(material);\r\n });\r\n } else {\r\n disposeMaterial(object.material);\r\n }\r\n }\r\n\r\n // 递归释放子对象\r\n if (object.children) {\r\n object.children.forEach((child) => disposeThreeObject(child));\r\n }\r\n};\r\n\r\n/**\r\n * 释放THREE.js材质\r\n * @param { Material } material\r\n */\r\nfunction disposeMaterial(material) {\r\n // 释放材质的纹理\r\n for (const key in material) {\r\n if (material[key] && material[key].isTexture) {\r\n material[key].dispose();\r\n }\r\n }\r\n material.dispose();\r\n}\r\n",
1500
+ "static": true,
1501
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/disposeObject.js",
1502
+ "access": "public",
1503
+ "description": null,
1504
+ "lineNumber": 1
1505
+ },
1506
+ {
1507
+ "__docId__": 83,
1508
+ "kind": "function",
1509
+ "name": "disposeThreeObject",
1510
+ "memberof": "src/utils/disposeObject.js",
1511
+ "generator": false,
1512
+ "async": false,
1513
+ "static": true,
1514
+ "longname": "src/utils/disposeObject.js~disposeThreeObject",
1515
+ "access": "public",
1516
+ "export": true,
1517
+ "importPath": "@ridp/threejs/src/utils/disposeObject.js",
1518
+ "importStyle": "{disposeThreeObject}",
1519
+ "description": "递归释放THREE.js对象 / 材质",
1520
+ "lineNumber": 5,
1521
+ "params": [
1522
+ {
1523
+ "nullable": null,
1524
+ "types": [
1525
+ " Object3D "
1526
+ ],
1527
+ "spread": false,
1528
+ "optional": false,
1529
+ "name": "object",
1530
+ "description": ""
1531
+ }
1532
+ ],
1533
+ "return": null
1534
+ },
1535
+ {
1536
+ "__docId__": 84,
1537
+ "kind": "function",
1538
+ "name": "disposeMaterial",
1539
+ "memberof": "src/utils/disposeObject.js",
1540
+ "generator": false,
1541
+ "async": false,
1542
+ "static": true,
1543
+ "longname": "src/utils/disposeObject.js~disposeMaterial",
1544
+ "access": "public",
1545
+ "export": false,
1546
+ "importPath": "@ridp/threejs/src/utils/disposeObject.js",
1547
+ "importStyle": null,
1548
+ "description": "释放THREE.js材质",
1549
+ "lineNumber": 31,
1550
+ "params": [
1551
+ {
1552
+ "nullable": null,
1553
+ "types": [
1554
+ " Material "
1555
+ ],
1556
+ "spread": false,
1557
+ "optional": false,
1558
+ "name": "material",
1559
+ "description": ""
1560
+ }
1561
+ ],
1562
+ "return": null,
1563
+ "ignore": true
1564
+ },
1565
+ {
1566
+ "__docId__": 85,
1567
+ "kind": "file",
1568
+ "name": "src/utils/helper.js",
1569
+ "content": "import {\r\n BoxHelper,\r\n GridHelper,\r\n Raycaster,\r\n Vector2,\r\n AxesHelper,\r\n Vector3,\r\n ArrowHelper,\r\n CameraHelper,\r\n} from \"three\";\r\nimport { OrbitControls } from \"three/addons/controls/OrbitControls.js\";\r\nimport { MapControls } from \"three/addons/controls/MapControls.js\";\r\nimport Stats from \"three/addons/libs/stats.module.js\";\r\n\r\nexport function createCameraHelper(camera) {\r\n return new CameraHelper(camera);\r\n}\r\n\r\nexport function createGridHelper(size = 150, ...args) {\r\n return new GridHelper(size, size / 10, ...args);\r\n}\r\n\r\nexport function createBox3Helper(model) {\r\n return new BoxHelper(model, 0xffff00);\r\n}\r\n\r\nexport function createOrbitControl(camera, dom) {\r\n return new OrbitControls(camera, dom);\r\n}\r\n\r\nexport function createMapControls(camera, dom) {\r\n return new MapControls(camera, dom);\r\n}\r\n\r\nexport function createRaycaster() {\r\n const raycaster = new Raycaster();\r\n const pointer = new Vector2(0, 0);\r\n return {\r\n raycaster,\r\n pointer,\r\n };\r\n}\r\n\r\nexport function createAxesHelper(size = 10) {\r\n return new AxesHelper(size);\r\n}\r\n\r\nexport function createArrowHelper(\r\n dir = new Vector3(1, 1, 1),\r\n ori = new Vector3(10, 10, 10),\r\n length = 5,\r\n hex = 0xffff00\r\n) {\r\n dir.normalize();\r\n return new ArrowHelper(dir, ori, length, hex);\r\n}\r\n\r\nexport function createStats() {\r\n const stats = new Stats();\r\n stats.dom.style.cssText =\r\n \"position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000\";\r\n return stats;\r\n}\r\n",
1570
+ "static": true,
1571
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/helper.js",
1572
+ "access": "public",
1573
+ "description": null,
1574
+ "lineNumber": 1
1575
+ },
1576
+ {
1577
+ "__docId__": 86,
1578
+ "kind": "function",
1579
+ "name": "createCameraHelper",
1580
+ "memberof": "src/utils/helper.js",
1581
+ "generator": false,
1582
+ "async": false,
1583
+ "static": true,
1584
+ "longname": "src/utils/helper.js~createCameraHelper",
1585
+ "access": "public",
1586
+ "export": true,
1587
+ "importPath": "@ridp/threejs/src/utils/helper.js",
1588
+ "importStyle": "{createCameraHelper}",
1589
+ "description": null,
1590
+ "lineNumber": 15,
1591
+ "undocument": true,
1592
+ "params": [
1593
+ {
1594
+ "name": "camera",
1595
+ "types": [
1596
+ "*"
1597
+ ]
1598
+ }
1599
+ ],
1600
+ "return": {
1601
+ "types": [
1602
+ "*"
1603
+ ]
1604
+ }
1605
+ },
1606
+ {
1607
+ "__docId__": 87,
1608
+ "kind": "function",
1609
+ "name": "createGridHelper",
1610
+ "memberof": "src/utils/helper.js",
1611
+ "generator": false,
1612
+ "async": false,
1613
+ "static": true,
1614
+ "longname": "src/utils/helper.js~createGridHelper",
1615
+ "access": "public",
1616
+ "export": true,
1617
+ "importPath": "@ridp/threejs/src/utils/helper.js",
1618
+ "importStyle": "{createGridHelper}",
1619
+ "description": null,
1620
+ "lineNumber": 19,
1621
+ "undocument": true,
1622
+ "params": [
1623
+ {
1624
+ "name": "size",
1625
+ "optional": true,
1626
+ "types": [
1627
+ "number"
1628
+ ],
1629
+ "defaultRaw": 150,
1630
+ "defaultValue": "150"
1631
+ },
1632
+ {
1633
+ "name": "args",
1634
+ "types": [
1635
+ "...*"
1636
+ ],
1637
+ "spread": true
1638
+ }
1639
+ ],
1640
+ "return": {
1641
+ "types": [
1642
+ "*"
1643
+ ]
1644
+ }
1645
+ },
1646
+ {
1647
+ "__docId__": 88,
1648
+ "kind": "function",
1649
+ "name": "createBox3Helper",
1650
+ "memberof": "src/utils/helper.js",
1651
+ "generator": false,
1652
+ "async": false,
1653
+ "static": true,
1654
+ "longname": "src/utils/helper.js~createBox3Helper",
1655
+ "access": "public",
1656
+ "export": true,
1657
+ "importPath": "@ridp/threejs/src/utils/helper.js",
1658
+ "importStyle": "{createBox3Helper}",
1659
+ "description": null,
1660
+ "lineNumber": 23,
1661
+ "undocument": true,
1662
+ "params": [
1663
+ {
1664
+ "name": "model",
1665
+ "types": [
1666
+ "*"
1667
+ ]
1668
+ }
1669
+ ],
1670
+ "return": {
1671
+ "types": [
1672
+ "*"
1673
+ ]
1674
+ }
1675
+ },
1676
+ {
1677
+ "__docId__": 89,
1678
+ "kind": "function",
1679
+ "name": "createOrbitControl",
1680
+ "memberof": "src/utils/helper.js",
1681
+ "generator": false,
1682
+ "async": false,
1683
+ "static": true,
1684
+ "longname": "src/utils/helper.js~createOrbitControl",
1685
+ "access": "public",
1686
+ "export": true,
1687
+ "importPath": "@ridp/threejs/src/utils/helper.js",
1688
+ "importStyle": "{createOrbitControl}",
1689
+ "description": null,
1690
+ "lineNumber": 27,
1691
+ "undocument": true,
1692
+ "params": [
1693
+ {
1694
+ "name": "camera",
1695
+ "types": [
1696
+ "*"
1697
+ ]
1698
+ },
1699
+ {
1700
+ "name": "dom",
1701
+ "types": [
1702
+ "*"
1703
+ ]
1704
+ }
1705
+ ],
1706
+ "return": {
1707
+ "types": [
1708
+ "*"
1709
+ ]
1710
+ }
1711
+ },
1712
+ {
1713
+ "__docId__": 90,
1714
+ "kind": "function",
1715
+ "name": "createMapControls",
1716
+ "memberof": "src/utils/helper.js",
1717
+ "generator": false,
1718
+ "async": false,
1719
+ "static": true,
1720
+ "longname": "src/utils/helper.js~createMapControls",
1721
+ "access": "public",
1722
+ "export": true,
1723
+ "importPath": "@ridp/threejs/src/utils/helper.js",
1724
+ "importStyle": "{createMapControls}",
1725
+ "description": null,
1726
+ "lineNumber": 31,
1727
+ "undocument": true,
1728
+ "params": [
1729
+ {
1730
+ "name": "camera",
1731
+ "types": [
1732
+ "*"
1733
+ ]
1734
+ },
1735
+ {
1736
+ "name": "dom",
1737
+ "types": [
1738
+ "*"
1739
+ ]
1740
+ }
1741
+ ],
1742
+ "return": {
1743
+ "types": [
1744
+ "*"
1745
+ ]
1746
+ }
1747
+ },
1748
+ {
1749
+ "__docId__": 91,
1750
+ "kind": "function",
1751
+ "name": "createRaycaster",
1752
+ "memberof": "src/utils/helper.js",
1753
+ "generator": false,
1754
+ "async": false,
1755
+ "static": true,
1756
+ "longname": "src/utils/helper.js~createRaycaster",
1757
+ "access": "public",
1758
+ "export": true,
1759
+ "importPath": "@ridp/threejs/src/utils/helper.js",
1760
+ "importStyle": "{createRaycaster}",
1761
+ "description": null,
1762
+ "lineNumber": 35,
1763
+ "undocument": true,
1764
+ "params": [],
1765
+ "return": {
1766
+ "types": [
1767
+ "{\"raycaster\": *, \"pointer\": *}"
1768
+ ]
1769
+ }
1770
+ },
1771
+ {
1772
+ "__docId__": 92,
1773
+ "kind": "function",
1774
+ "name": "createAxesHelper",
1775
+ "memberof": "src/utils/helper.js",
1776
+ "generator": false,
1777
+ "async": false,
1778
+ "static": true,
1779
+ "longname": "src/utils/helper.js~createAxesHelper",
1780
+ "access": "public",
1781
+ "export": true,
1782
+ "importPath": "@ridp/threejs/src/utils/helper.js",
1783
+ "importStyle": "{createAxesHelper}",
1784
+ "description": null,
1785
+ "lineNumber": 44,
1786
+ "undocument": true,
1787
+ "params": [
1788
+ {
1789
+ "name": "size",
1790
+ "optional": true,
1791
+ "types": [
1792
+ "number"
1793
+ ],
1794
+ "defaultRaw": 10,
1795
+ "defaultValue": "10"
1796
+ }
1797
+ ],
1798
+ "return": {
1799
+ "types": [
1800
+ "*"
1801
+ ]
1802
+ }
1803
+ },
1804
+ {
1805
+ "__docId__": 93,
1806
+ "kind": "function",
1807
+ "name": "createArrowHelper",
1808
+ "memberof": "src/utils/helper.js",
1809
+ "generator": false,
1810
+ "async": false,
1811
+ "static": true,
1812
+ "longname": "src/utils/helper.js~createArrowHelper",
1813
+ "access": "public",
1814
+ "export": true,
1815
+ "importPath": "@ridp/threejs/src/utils/helper.js",
1816
+ "importStyle": "{createArrowHelper}",
1817
+ "description": null,
1818
+ "lineNumber": 48,
1819
+ "undocument": true,
1820
+ "params": [
1821
+ {
1822
+ "name": "dir",
1823
+ "optional": true,
1824
+ "types": [
1825
+ "*"
1826
+ ]
1827
+ },
1828
+ {
1829
+ "name": "ori",
1830
+ "optional": true,
1831
+ "types": [
1832
+ "*"
1833
+ ]
1834
+ },
1835
+ {
1836
+ "name": "length",
1837
+ "optional": true,
1838
+ "types": [
1839
+ "number"
1840
+ ],
1841
+ "defaultRaw": 5,
1842
+ "defaultValue": "5"
1843
+ },
1844
+ {
1845
+ "name": "hex",
1846
+ "optional": true,
1847
+ "types": [
1848
+ "number"
1849
+ ],
1850
+ "defaultRaw": 16776960,
1851
+ "defaultValue": "16776960"
1852
+ }
1853
+ ],
1854
+ "return": {
1855
+ "types": [
1856
+ "*"
1857
+ ]
1858
+ }
1859
+ },
1860
+ {
1861
+ "__docId__": 94,
1862
+ "kind": "function",
1863
+ "name": "createStats",
1864
+ "memberof": "src/utils/helper.js",
1865
+ "generator": false,
1866
+ "async": false,
1867
+ "static": true,
1868
+ "longname": "src/utils/helper.js~createStats",
1869
+ "access": "public",
1870
+ "export": true,
1871
+ "importPath": "@ridp/threejs/src/utils/helper.js",
1872
+ "importStyle": "{createStats}",
1873
+ "description": null,
1874
+ "lineNumber": 58,
1875
+ "undocument": true,
1876
+ "params": [],
1877
+ "return": {
1878
+ "types": [
1879
+ "*"
1880
+ ]
1881
+ }
1882
+ },
1883
+ {
1884
+ "__docId__": 95,
1885
+ "kind": "file",
1886
+ "name": "src/utils/ImageLoader.js",
1887
+ "content": "import { RGBELoader } from \"three/examples/jsm/Addons.js\";\r\nimport { EquirectangularReflectionMapping } from \"three\";\r\n\r\nconst cacheHdr = {};\r\n\r\nconst rgbeLoader = new RGBELoader();\r\n/**\r\n * 环境贴图加载 && 缓存 && 设置到 scene\r\n * @param { THREE.Scene } scene threejs 场景对象\r\n * @param { String } path 图片地址\r\n * @returns\r\n */\r\nexport async function initEnvImage(scene, path) {\r\n if (!path) return;\r\n if (cacheHdr[path]) {\r\n const texture = cacheHdr[path];\r\n scene.environment = texture;\r\n return;\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n rgbeLoader.load(path, resolve, undefined, reject);\r\n })\r\n .then((texture) => {\r\n texture.mapping = EquirectangularReflectionMapping;\r\n scene.environment = texture;\r\n cacheHdr[path] = texture;\r\n })\r\n .catch((e) => {\r\n console.log(\" =====> e:\", e);\r\n });\r\n}\r\n\r\n/**\r\n * 图片纹理加载\r\n * @param {*} path 图片路径\r\n * @returns\r\n */\r\nexport async function ImageLoader(path) {\r\n return new Promise((resolve, reject) => {\r\n rgbeLoader.load(path, resolve, undefined, reject);\r\n });\r\n}\r\n",
1888
+ "static": true,
1889
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/ImageLoader.js",
1890
+ "access": "public",
1891
+ "description": null,
1892
+ "lineNumber": 1
1893
+ },
1894
+ {
1895
+ "__docId__": 96,
1896
+ "kind": "variable",
1897
+ "name": "cacheHdr",
1898
+ "memberof": "src/utils/ImageLoader.js",
1899
+ "static": true,
1900
+ "longname": "src/utils/ImageLoader.js~cacheHdr",
1901
+ "access": "public",
1902
+ "export": false,
1903
+ "importPath": "@ridp/threejs/src/utils/ImageLoader.js",
1904
+ "importStyle": null,
1905
+ "description": null,
1906
+ "lineNumber": 4,
1907
+ "undocument": true,
1908
+ "type": {
1909
+ "types": [
1910
+ "{}"
1911
+ ]
1912
+ },
1913
+ "ignore": true
1914
+ },
1915
+ {
1916
+ "__docId__": 97,
1917
+ "kind": "variable",
1918
+ "name": "rgbeLoader",
1919
+ "memberof": "src/utils/ImageLoader.js",
1920
+ "static": true,
1921
+ "longname": "src/utils/ImageLoader.js~rgbeLoader",
1922
+ "access": "public",
1923
+ "export": false,
1924
+ "importPath": "@ridp/threejs/src/utils/ImageLoader.js",
1925
+ "importStyle": null,
1926
+ "description": null,
1927
+ "lineNumber": 6,
1928
+ "undocument": true,
1929
+ "type": {
1930
+ "types": [
1931
+ "*"
1932
+ ]
1933
+ },
1934
+ "ignore": true
1935
+ },
1936
+ {
1937
+ "__docId__": 98,
1938
+ "kind": "function",
1939
+ "name": "initEnvImage",
1940
+ "memberof": "src/utils/ImageLoader.js",
1941
+ "generator": false,
1942
+ "async": true,
1943
+ "static": true,
1944
+ "longname": "src/utils/ImageLoader.js~initEnvImage",
1945
+ "access": "public",
1946
+ "export": true,
1947
+ "importPath": "@ridp/threejs/src/utils/ImageLoader.js",
1948
+ "importStyle": "{initEnvImage}",
1949
+ "description": "环境贴图加载 && 缓存 && 设置到 scene",
1950
+ "lineNumber": 13,
1951
+ "unknown": [
1952
+ {
1953
+ "tagName": "@returns",
1954
+ "tagValue": ""
1955
+ }
1956
+ ],
1957
+ "params": [
1958
+ {
1959
+ "nullable": null,
1960
+ "types": [
1961
+ " THREE.Scene "
1962
+ ],
1963
+ "spread": false,
1964
+ "optional": false,
1965
+ "name": "scene",
1966
+ "description": "threejs 场景对象"
1967
+ },
1968
+ {
1969
+ "nullable": null,
1970
+ "types": [
1971
+ " String "
1972
+ ],
1973
+ "spread": false,
1974
+ "optional": false,
1975
+ "name": "path",
1976
+ "description": "图片地址"
1977
+ }
1978
+ ],
1979
+ "return": {
1980
+ "types": [
1981
+ "*"
1982
+ ]
1983
+ }
1984
+ },
1985
+ {
1986
+ "__docId__": 99,
1987
+ "kind": "function",
1988
+ "name": "ImageLoader",
1989
+ "memberof": "src/utils/ImageLoader.js",
1990
+ "generator": false,
1991
+ "async": true,
1992
+ "static": true,
1993
+ "longname": "src/utils/ImageLoader.js~ImageLoader",
1994
+ "access": "public",
1995
+ "export": true,
1996
+ "importPath": "@ridp/threejs/src/utils/ImageLoader.js",
1997
+ "importStyle": "{ImageLoader}",
1998
+ "description": "图片纹理加载",
1999
+ "lineNumber": 39,
2000
+ "unknown": [
2001
+ {
2002
+ "tagName": "@returns",
2003
+ "tagValue": ""
2004
+ }
2005
+ ],
2006
+ "params": [
2007
+ {
2008
+ "nullable": null,
2009
+ "types": [
2010
+ "*"
2011
+ ],
2012
+ "spread": false,
2013
+ "optional": false,
2014
+ "name": "path",
2015
+ "description": "图片路径"
2016
+ }
2017
+ ],
2018
+ "return": {
2019
+ "types": [
2020
+ "*"
2021
+ ]
2022
+ }
2023
+ },
2024
+ {
2025
+ "__docId__": 100,
2026
+ "kind": "file",
2027
+ "name": "src/utils/index.js",
2028
+ "content": "export * from \"./helper.js\";\r\nexport * from \"./css3dHelper.js\";\r\nexport * from \"./disposeObject.js\";\r\nexport * from \"./common.js\";\r\nexport * from \"./ImageLoader.js\";\r\n",
2029
+ "static": true,
2030
+ "longname": "C:/project/RIDP.HMC_3D_Visualization-dev/packages/threejs/src/utils/index.js",
2031
+ "access": "public",
2032
+ "description": null,
2033
+ "lineNumber": 1
2034
+ },
2035
+ {
2036
+ "kind": "index",
2037
+ "content": "# @ridp/threejs \r\n\r\n## Hooks \r\n\r\n- useThreeJs\r\n 声明: \r\n\r\n ```javascript\r\n /**\r\n * \r\n * @param {String} selector ID '#xxxx'\r\n * @param {Object} option - 初始化参数\r\n * @property {Boolean} option.css3d - 模型\r\n * @returns any\r\n */\r\n function useThreeJs(selector, option)\r\n ```\r\n\r\n 使用: \r\n ```javascript\r\n import { useThreeJs } from '@ridp/threejs'\r\n\r\n const { scene, camera, renderer, control, domWidth, domHeight, isReady, addAnimate, frameArea } = useThreeJs(\"#InsId\", )\r\n\r\n ```\r\n ---- \r\n 返回变量: \r\n * scene\r\n ```javascript \r\n THREE.Scene \r\n\r\n ```\r\n * camera: \r\n ```javascript \r\n THREE.PerspectiveCamera \r\n ```\r\n * renderer\r\n ```javascript \r\n const renderer = new WebGLRenderer({\r\n antialias: true,\r\n alpha: true,\r\n precision: \"mediump\",\r\n logarithmicDepthBuffer: true,\r\n })\r\n ```\r\n * control\r\n ```javascript \r\n THREE.OrbitControls\r\n ```\r\n * domWidth\r\n ```javascript\r\n ref(Number)\r\n ```\r\n * domHeight\r\n ```javascript\r\n ref(Number)\r\n ```\r\n * isReady \r\n ```javascript\r\n ref(Boolean)\r\n ```\r\n ------ \r\n 返回方法: \r\n * addAnimate \r\n ```javascript\r\n /**\r\n * 循环帧中添加执行函数\r\n * @param {*} animate \r\n */\r\n function addAnimate(animate): void\r\n\r\n ```\r\n\r\n * frameArea \r\n ```javascript\r\n /**物体视窗自动适应\r\n *\r\n * @param {Object3D} model\r\n * @param {Number} scale\r\n * @param {Camera} camera\r\n * @param {OrbitControls} controls\r\n * @param {Vector3} offset\r\n */\r\n function frameArea(model, scale, camera, controls, offset): void\r\n ```\r\n- useRaycaster\r\n- useObb\r\n- useGLTFLoader\r\n\r\n# Instance 实例\r\n\r\n\r\n# Utils 工具",
2038
+ "longname": "C:\\project\\RIDP.HMC_3D_Visualization-dev\\packages\\threejs\\README.md",
2039
+ "name": "./README.md",
2040
+ "static": true,
2041
+ "access": "public"
2042
+ },
2043
+ {
2044
+ "kind": "packageJSON",
2045
+ "content": "{\n \"name\": \"@ridp/threejs\",\n \"private\": false,\n \"version\": \"1.0.0\",\n \"type\": \"module\",\n \"main\": \"dist/threejs.js\",\n \"scripts\": {\n \"build\": \"vite build\",\n \"build:doc\": \"npx esdoc\"\n },\n \"exports\": {\n \".\": {\n \"import\": \"./dist/threejs.js\",\n \"require\": \"./dist/threejs.cjs\"\n },\n \"./hooks\": {\n \"import\": \"./dist/hooks.js\",\n \"require\": \"./dist/hooks.cjs\"\n },\n \"./utils\": {\n \"import\": \"./dist/utils.js\",\n \"require\": \"./dist/utils.cjs\"\n }\n },\n \"dependencies\": {\n \"dexie\": \"^4.0.11\",\n \"esdoc\": \"^1.1.0\",\n \"esdoc-ecmascript-proposal-plugin\": \"^1.0.0\",\n \"esdoc-importpath-plugin\": \"^1.0.2\",\n \"esdoc-inject-style-plugin\": \"^1.0.0\",\n \"esdoc-jsx-plugin\": \"^1.0.0\",\n \"esdoc-standard-plugin\": \"^1.0.0\",\n \"three\": \"^0.175.0\",\n \"vite\": \"^6.3.1\",\n \"vue\": \"^3.5.13\"\n },\n \"files\": [\n \"dist/*\",\n \"static/\"\n ],\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n",
2046
+ "longname": "C:\\project\\RIDP.HMC_3D_Visualization-dev\\packages\\threejs\\package.json",
2047
+ "name": "package.json",
2048
+ "static": true,
2049
+ "access": "public"
2050
+ }
2051
2051
  ]