@chocozhang/three-model-render 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +134 -97
- package/dist/camera/index.d.ts +59 -36
- package/dist/camera/index.js +83 -67
- package/dist/camera/index.js.map +1 -1
- package/dist/camera/index.mjs +83 -67
- package/dist/camera/index.mjs.map +1 -1
- package/dist/core/index.d.ts +81 -28
- package/dist/core/index.js +194 -104
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +194 -105
- package/dist/core/index.mjs.map +1 -1
- package/dist/effect/index.d.ts +47 -134
- package/dist/effect/index.js +287 -288
- package/dist/effect/index.js.map +1 -1
- package/dist/effect/index.mjs +287 -288
- package/dist/effect/index.mjs.map +1 -1
- package/dist/index.d.ts +432 -349
- package/dist/index.js +1399 -1228
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1395 -1229
- package/dist/index.mjs.map +1 -1
- package/dist/interaction/index.d.ts +85 -52
- package/dist/interaction/index.js +168 -142
- package/dist/interaction/index.js.map +1 -1
- package/dist/interaction/index.mjs +168 -142
- package/dist/interaction/index.mjs.map +1 -1
- package/dist/loader/index.d.ts +106 -58
- package/dist/loader/index.js +492 -454
- package/dist/loader/index.js.map +1 -1
- package/dist/loader/index.mjs +491 -455
- package/dist/loader/index.mjs.map +1 -1
- package/dist/setup/index.d.ts +26 -24
- package/dist/setup/index.js +125 -163
- package/dist/setup/index.js.map +1 -1
- package/dist/setup/index.mjs +124 -164
- package/dist/setup/index.mjs.map +1 -1
- package/dist/ui/index.d.ts +18 -7
- package/dist/ui/index.js +45 -37
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +45 -37
- package/dist/ui/index.mjs.map +1 -1
- package/package.json +50 -22
package/dist/setup/index.mjs
CHANGED
|
@@ -1,178 +1,138 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* - 添加灯光强度调整方法
|
|
8
|
-
* - 完善错误处理
|
|
9
|
-
* - 优化dispose逻辑
|
|
10
|
-
*
|
|
11
|
-
* - camera: THREE.PerspectiveCamera(会被移动并指向模型中心)
|
|
12
|
-
* - scene: THREE.Scene(会把新创建的 light group 加入 scene)
|
|
13
|
-
* - model: THREE.Object3D 已加载的模型(任意 transform/坐标)
|
|
14
|
-
* - options: 可选配置(见 AutoSetupOptions)
|
|
15
|
-
*
|
|
16
|
-
* 返回 AutoSetupHandle,调用方在组件卸载/切换时请调用 handle.dispose()
|
|
4
|
+
* @file autoSetup.ts
|
|
5
|
+
* @description
|
|
6
|
+
* Automatically sets up the camera and basic lighting scene based on the model's bounding box.
|
|
17
7
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Fit camera to object bounding box
|
|
10
|
+
*/
|
|
11
|
+
function fitCameraToObject(camera, object, padding = 1.2, elevation = 0.2) {
|
|
12
|
+
const box = new THREE.Box3().setFromObject(object);
|
|
13
|
+
if (!isFinite(box.min.x))
|
|
14
|
+
return { center: new THREE.Vector3(), radius: 0 };
|
|
15
|
+
const sphere = new THREE.Sphere();
|
|
16
|
+
box.getBoundingSphere(sphere);
|
|
17
|
+
const center = sphere.center.clone();
|
|
18
|
+
const radius = Math.max(0.001, sphere.radius);
|
|
19
|
+
const fov = (camera.fov * Math.PI) / 180;
|
|
20
|
+
const halfFov = fov / 2;
|
|
21
|
+
const sinHalfFov = Math.max(Math.sin(halfFov), 0.001);
|
|
22
|
+
const distance = (radius * padding) / sinHalfFov;
|
|
23
|
+
const dir = new THREE.Vector3(0, Math.sin(elevation), Math.cos(elevation)).normalize();
|
|
24
|
+
const desiredPos = center.clone().add(dir.multiplyScalar(distance));
|
|
25
|
+
camera.position.copy(desiredPos);
|
|
26
|
+
camera.lookAt(center);
|
|
27
|
+
camera.near = Math.max(0.001, radius / 1000);
|
|
28
|
+
camera.far = Math.max(1000, radius * 50);
|
|
29
|
+
camera.updateProjectionMatrix();
|
|
30
|
+
return { center, radius };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Setup default lighting for a model
|
|
34
|
+
*/
|
|
35
|
+
function setupDefaultLights(scene, model, options = {}) {
|
|
36
|
+
const box = new THREE.Box3().setFromObject(model);
|
|
37
|
+
const sphere = new THREE.Sphere();
|
|
38
|
+
box.getBoundingSphere(sphere);
|
|
39
|
+
const center = sphere.center.clone();
|
|
40
|
+
const radius = Math.max(0.001, sphere.radius);
|
|
24
41
|
const opts = {
|
|
25
|
-
padding:
|
|
26
|
-
elevation:
|
|
27
|
-
enableShadows:
|
|
28
|
-
shadowMapSize:
|
|
29
|
-
directionalCount:
|
|
30
|
-
setMeshShadowProps:
|
|
31
|
-
renderer:
|
|
42
|
+
padding: options.padding ?? 1.2,
|
|
43
|
+
elevation: options.elevation ?? 0.2,
|
|
44
|
+
enableShadows: options.enableShadows ?? false,
|
|
45
|
+
shadowMapSize: options.shadowMapSize ?? 1024,
|
|
46
|
+
directionalCount: options.directionalCount ?? 4,
|
|
47
|
+
setMeshShadowProps: options.setMeshShadowProps ?? true,
|
|
48
|
+
renderer: options.renderer ?? null,
|
|
32
49
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// 4.2 方向光
|
|
75
|
-
const dirCount = Math.max(1, Math.floor(opts.directionalCount));
|
|
76
|
-
const directionalLights = [];
|
|
77
|
-
const dirs = [];
|
|
78
|
-
dirs.push(new THREE.Vector3(0, 1, 0));
|
|
79
|
-
for (let i = 0; i < Math.max(1, dirCount); i++) {
|
|
80
|
-
const angle = (i / Math.max(1, dirCount)) * Math.PI * 2;
|
|
81
|
-
const v = new THREE.Vector3(Math.cos(angle), 0.3, Math.sin(angle)).normalize();
|
|
82
|
-
dirs.push(v);
|
|
50
|
+
if (opts.renderer && opts.enableShadows) {
|
|
51
|
+
opts.renderer.shadowMap.enabled = true;
|
|
52
|
+
opts.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
|
53
|
+
}
|
|
54
|
+
const lightsGroup = new THREE.Group();
|
|
55
|
+
lightsGroup.name = 'autoSetupLightsGroup';
|
|
56
|
+
lightsGroup.position.copy(center);
|
|
57
|
+
scene.add(lightsGroup);
|
|
58
|
+
const hemi = new THREE.HemisphereLight(0xffffff, 0x444444, 0.6);
|
|
59
|
+
hemi.position.set(0, radius * 2.0, 0);
|
|
60
|
+
lightsGroup.add(hemi);
|
|
61
|
+
const ambient = new THREE.AmbientLight(0xffffff, 0.25);
|
|
62
|
+
lightsGroup.add(ambient);
|
|
63
|
+
const dirCount = Math.max(1, Math.floor(opts.directionalCount));
|
|
64
|
+
const dirs = [new THREE.Vector3(0, 1, 0)];
|
|
65
|
+
for (let i = 0; i < dirCount; i++) {
|
|
66
|
+
const angle = (i / dirCount) * Math.PI * 2;
|
|
67
|
+
const v = new THREE.Vector3(Math.cos(angle), 0.3, Math.sin(angle)).normalize();
|
|
68
|
+
dirs.push(v);
|
|
69
|
+
}
|
|
70
|
+
const shadowCamSize = Math.max(1, radius * 1.5);
|
|
71
|
+
dirs.forEach((d, i) => {
|
|
72
|
+
const light = new THREE.DirectionalLight(0xffffff, i === 0 ? 1.5 : 1.2);
|
|
73
|
+
light.position.copy(d.clone().multiplyScalar(radius * 2.5));
|
|
74
|
+
light.target.position.copy(center);
|
|
75
|
+
light.name = `auto_dir_${i}`;
|
|
76
|
+
lightsGroup.add(light);
|
|
77
|
+
lightsGroup.add(light.target);
|
|
78
|
+
if (opts.enableShadows) {
|
|
79
|
+
light.castShadow = true;
|
|
80
|
+
light.shadow.mapSize.width = opts.shadowMapSize;
|
|
81
|
+
light.shadow.mapSize.height = opts.shadowMapSize;
|
|
82
|
+
const cam = light.shadow.camera;
|
|
83
|
+
const s = shadowCamSize;
|
|
84
|
+
cam.left = -s;
|
|
85
|
+
cam.right = s;
|
|
86
|
+
cam.top = s;
|
|
87
|
+
cam.bottom = -s;
|
|
88
|
+
cam.near = 0.1;
|
|
89
|
+
cam.far = radius * 10 + 50;
|
|
90
|
+
light.shadow.bias = -5e-4;
|
|
83
91
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
lightsGroup.add(light.target);
|
|
93
|
-
if (opts.enableShadows) {
|
|
94
|
-
light.castShadow = true;
|
|
95
|
-
light.shadow.mapSize.width = opts.shadowMapSize;
|
|
96
|
-
light.shadow.mapSize.height = opts.shadowMapSize;
|
|
97
|
-
const cam = light.shadow.camera;
|
|
98
|
-
const s = shadowCamSize;
|
|
99
|
-
cam.left = -s;
|
|
100
|
-
cam.right = s;
|
|
101
|
-
cam.top = s;
|
|
102
|
-
cam.bottom = -s;
|
|
103
|
-
cam.near = 0.1;
|
|
104
|
-
cam.far = radius * 10 + 50;
|
|
105
|
-
light.shadow.bias = -0.0005;
|
|
92
|
+
});
|
|
93
|
+
if (opts.setMeshShadowProps) {
|
|
94
|
+
model.traverse((ch) => {
|
|
95
|
+
if (ch.isMesh) {
|
|
96
|
+
const mesh = ch;
|
|
97
|
+
const isSkinned = mesh.isSkinnedMesh;
|
|
98
|
+
mesh.castShadow = opts.enableShadows && !isSkinned ? true : mesh.castShadow;
|
|
99
|
+
mesh.receiveShadow = opts.enableShadows ? true : mesh.receiveShadow;
|
|
106
100
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
// --- 5) 设置 Mesh 阴影属性
|
|
119
|
-
if (opts.setMeshShadowProps) {
|
|
120
|
-
model.traverse((ch) => {
|
|
121
|
-
if (ch.isMesh) {
|
|
122
|
-
const mesh = ch;
|
|
123
|
-
const isSkinned = mesh.isSkinnedMesh;
|
|
124
|
-
mesh.castShadow = opts.enableShadows && !isSkinned ? true : mesh.castShadow;
|
|
125
|
-
mesh.receiveShadow = opts.enableShadows ? true : mesh.receiveShadow;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
const handle = {
|
|
104
|
+
lightsGroup,
|
|
105
|
+
center,
|
|
106
|
+
radius,
|
|
107
|
+
updateLightIntensity(factor) {
|
|
108
|
+
lightsGroup.traverse((node) => {
|
|
109
|
+
if (node.isLight) {
|
|
110
|
+
const light = node;
|
|
111
|
+
light.intensity *= factor; // Simple implementation
|
|
126
112
|
}
|
|
127
113
|
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (node.isLight) {
|
|
138
|
-
const light = node;
|
|
139
|
-
const originalIntensity = parseFloat(light.name.split('_').pop() || '1');
|
|
140
|
-
light.intensity = originalIntensity * Math.max(0, factor);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
dispose: () => {
|
|
145
|
-
try {
|
|
146
|
-
// 移除灯光组
|
|
147
|
-
if (lightsGroup.parent)
|
|
148
|
-
lightsGroup.parent.remove(lightsGroup);
|
|
149
|
-
// 清理阴影资源
|
|
150
|
-
lightsGroup.traverse((node) => {
|
|
151
|
-
if (node.isLight) {
|
|
152
|
-
const l = node;
|
|
153
|
-
if (l.shadow && l.shadow.map) {
|
|
154
|
-
try {
|
|
155
|
-
l.shadow.map.dispose();
|
|
156
|
-
}
|
|
157
|
-
catch (err) {
|
|
158
|
-
console.warn('Failed to dispose shadow map:', err);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
catch (error) {
|
|
165
|
-
console.error('autoSetupCameraAndLight: dispose failed', error);
|
|
114
|
+
},
|
|
115
|
+
dispose: () => {
|
|
116
|
+
if (lightsGroup.parent)
|
|
117
|
+
lightsGroup.parent.remove(lightsGroup);
|
|
118
|
+
lightsGroup.traverse((node) => {
|
|
119
|
+
if (node.isLight) {
|
|
120
|
+
const l = node;
|
|
121
|
+
if (l.shadow && l.shadow.map)
|
|
122
|
+
l.shadow.map.dispose();
|
|
166
123
|
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
return handle;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Automatically setup camera and basic lighting (Combine fitCameraToObject and setupDefaultLights)
|
|
131
|
+
*/
|
|
132
|
+
function autoSetupCameraAndLight(camera, scene, model, options = {}) {
|
|
133
|
+
fitCameraToObject(camera, model, options.padding, options.elevation);
|
|
134
|
+
return setupDefaultLights(scene, model, options);
|
|
175
135
|
}
|
|
176
136
|
|
|
177
|
-
export { autoSetupCameraAndLight };
|
|
137
|
+
export { autoSetupCameraAndLight, fitCameraToObject, setupDefaultLights };
|
|
178
138
|
//# sourceMappingURL=index.mjs.map
|
package/dist/setup/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/setup/autoSetup.ts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/setup/autoSetup.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;AAIG;AA6BH;;AAEG;AACG,SAAU,iBAAiB,CAC/B,MAA+B,EAC/B,MAAsB,EACtB,OAAO,GAAG,GAAG,EACb,SAAS,GAAG,GAAG,EAAA;AAEf,IAAA,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC;IAClD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,EAAE,MAAM,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;AAE3E,IAAA,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE;AACjC,IAAA,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC;IAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;AACpC,IAAA,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;AAE7C,IAAA,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG;AACxC,IAAA,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC;AACvB,IAAA,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IACrD,MAAM,QAAQ,GAAG,CAAC,MAAM,GAAG,OAAO,IAAI,UAAU;IAEhD,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAC3B,CAAC,EACD,I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G,IAAmB;AACjC,oBAAA,KAAK,CAAC,SAAS,IAAI,MAAM,CAAA;gBAC3B;AACF,YAAA,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,MAAK;YACZ,IAAI,WAAW,CAAC,MAAM;AAAE,gBAAA,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;AAC9D,YAAA,WAAW,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAI;AAC5B,gBAAA,IAAK,IAAY,CAAC,OAAO,EAAE;oBACzB,MAAM,CAAC,GAAG,IAAsC;oBAChD,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG;AAAE,wBAAA,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE;gBACtD;AACF,YAAA,CAAC,CAAC;QACJ;KACD;AAED,IAAA,OAAO,MAAM;AACf;AAEA;;AAEG;AACG,SAAU,uBAAuB,CACrC,MAA+B,EAC/B,KAAkB,EAClB,KAAqB,EACrB,OAAA,GAA4B,EAAE,EAAA;AAE9B,IAAA,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC;IACpE,OAAO,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC;AAClD;;;;"}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @file modelsLabel.ts
|
|
5
|
+
* @description
|
|
6
|
+
* Creates interactive 2D labels (DOM elements) attached to 3D objects with connecting lines.
|
|
7
|
+
*
|
|
8
|
+
* @best-practice
|
|
9
|
+
* - Use `createModelsLabel` to annotate parts of a model.
|
|
10
|
+
* - Supports fading endpoints, pulsing dots, and custom styling.
|
|
11
|
+
* - Performance optimized with caching and RAF throttling.
|
|
12
|
+
*/
|
|
13
|
+
|
|
3
14
|
interface LabelOptions {
|
|
4
15
|
fontSize?: string;
|
|
5
16
|
color?: string;
|
|
@@ -22,14 +33,14 @@ interface LabelManager {
|
|
|
22
33
|
dispose: () => void;
|
|
23
34
|
}
|
|
24
35
|
/**
|
|
25
|
-
*
|
|
36
|
+
* Create Model Labels (with connecting lines and pulsing dots) - Optimized
|
|
26
37
|
*
|
|
27
|
-
*
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
30
|
-
* -
|
|
31
|
-
* -
|
|
32
|
-
* - RAF
|
|
38
|
+
* Features:
|
|
39
|
+
* - Supports pause/resume
|
|
40
|
+
* - Configurable update interval
|
|
41
|
+
* - Fade in/out effects
|
|
42
|
+
* - Cached bounding box calculation
|
|
43
|
+
* - RAF management optimization
|
|
33
44
|
*/
|
|
34
45
|
declare function createModelsLabel(camera: THREE.Camera, renderer: THREE.WebGLRenderer, parentModel: THREE.Object3D, modelLabelsMap: Record<string, string>, options?: LabelOptions): LabelManager;
|
|
35
46
|
|
package/dist/ui/index.js
CHANGED
|
@@ -22,30 +22,39 @@ function _interopNamespaceDefault(e) {
|
|
|
22
22
|
var THREE__namespace = /*#__PURE__*/_interopNamespaceDefault(THREE);
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* @file modelsLabel.ts
|
|
26
|
+
* @description
|
|
27
|
+
* Creates interactive 2D labels (DOM elements) attached to 3D objects with connecting lines.
|
|
26
28
|
*
|
|
27
|
-
*
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
30
|
-
* -
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
* @best-practice
|
|
30
|
+
* - Use `createModelsLabel` to annotate parts of a model.
|
|
31
|
+
* - Supports fading endpoints, pulsing dots, and custom styling.
|
|
32
|
+
* - Performance optimized with caching and RAF throttling.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Create Model Labels (with connecting lines and pulsing dots) - Optimized
|
|
36
|
+
*
|
|
37
|
+
* Features:
|
|
38
|
+
* - Supports pause/resume
|
|
39
|
+
* - Configurable update interval
|
|
40
|
+
* - Fade in/out effects
|
|
41
|
+
* - Cached bounding box calculation
|
|
42
|
+
* - RAF management optimization
|
|
33
43
|
*/
|
|
34
44
|
function createModelsLabel(camera, renderer, parentModel, modelLabelsMap, options) {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f;
|
|
36
45
|
const cfg = {
|
|
37
|
-
fontSize:
|
|
38
|
-
color:
|
|
39
|
-
background:
|
|
40
|
-
padding:
|
|
41
|
-
borderRadius:
|
|
42
|
-
lift:
|
|
43
|
-
dotSize:
|
|
44
|
-
dotSpacing:
|
|
45
|
-
lineColor:
|
|
46
|
-
lineWidth:
|
|
47
|
-
updateInterval:
|
|
48
|
-
fadeInDuration:
|
|
46
|
+
fontSize: options?.fontSize || '12px',
|
|
47
|
+
color: options?.color || '#ffffff',
|
|
48
|
+
background: options?.background || '#1890ff',
|
|
49
|
+
padding: options?.padding || '6px 10px',
|
|
50
|
+
borderRadius: options?.borderRadius || '6px',
|
|
51
|
+
lift: options?.lift ?? 100,
|
|
52
|
+
dotSize: options?.dotSize ?? 6,
|
|
53
|
+
dotSpacing: options?.dotSpacing ?? 2,
|
|
54
|
+
lineColor: options?.lineColor || 'rgba(200,200,200,0.7)',
|
|
55
|
+
lineWidth: options?.lineWidth ?? 1,
|
|
56
|
+
updateInterval: options?.updateInterval ?? 0, // Default update every frame
|
|
57
|
+
fadeInDuration: options?.fadeInDuration ?? 300, // Fade-in duration
|
|
49
58
|
};
|
|
50
59
|
const container = document.createElement('div');
|
|
51
60
|
container.style.position = 'absolute';
|
|
@@ -68,13 +77,13 @@ function createModelsLabel(camera, renderer, parentModel, modelLabelsMap, option
|
|
|
68
77
|
svg.style.zIndex = '1';
|
|
69
78
|
container.appendChild(svg);
|
|
70
79
|
let currentModel = parentModel;
|
|
71
|
-
let currentLabelsMap =
|
|
80
|
+
let currentLabelsMap = { ...modelLabelsMap };
|
|
72
81
|
let labels = [];
|
|
73
82
|
let isActive = true;
|
|
74
|
-
let isPaused = false;
|
|
75
|
-
let rafId = null;
|
|
76
|
-
let lastUpdateTime = 0;
|
|
77
|
-
//
|
|
83
|
+
let isPaused = false;
|
|
84
|
+
let rafId = null;
|
|
85
|
+
let lastUpdateTime = 0;
|
|
86
|
+
// Inject styles (with fade-in animation)
|
|
78
87
|
const styleId = 'three-model-label-styles';
|
|
79
88
|
if (!document.getElementById(styleId)) {
|
|
80
89
|
const style = document.createElement('style');
|
|
@@ -113,14 +122,14 @@ function createModelsLabel(camera, renderer, parentModel, modelLabelsMap, option
|
|
|
113
122
|
`;
|
|
114
123
|
document.head.appendChild(style);
|
|
115
124
|
}
|
|
116
|
-
//
|
|
125
|
+
// Get or update cached top position
|
|
117
126
|
const getObjectTopPosition = (labelData) => {
|
|
118
127
|
const obj = labelData.object;
|
|
119
|
-
//
|
|
128
|
+
// If cached and object hasn't transformed, return cached
|
|
120
129
|
if (labelData.cachedTopPos && !obj.matrixWorldNeedsUpdate) {
|
|
121
130
|
return labelData.cachedTopPos.clone();
|
|
122
131
|
}
|
|
123
|
-
//
|
|
132
|
+
// Recalculate
|
|
124
133
|
const box = new THREE__namespace.Box3().setFromObject(obj);
|
|
125
134
|
labelData.cachedBox = box;
|
|
126
135
|
if (!box.isEmpty()) {
|
|
@@ -149,9 +158,8 @@ function createModelsLabel(camera, renderer, parentModel, modelLabelsMap, option
|
|
|
149
158
|
if (!currentModel)
|
|
150
159
|
return;
|
|
151
160
|
currentModel.traverse((child) => {
|
|
152
|
-
var _a;
|
|
153
161
|
if (child.isMesh || child.type === 'Group') {
|
|
154
|
-
const labelText =
|
|
162
|
+
const labelText = Object.entries(currentLabelsMap).find(([key]) => child.name.includes(key))?.[1];
|
|
155
163
|
if (!labelText)
|
|
156
164
|
return;
|
|
157
165
|
const wrapper = document.createElement('div');
|
|
@@ -198,20 +206,20 @@ function createModelsLabel(camera, renderer, parentModel, modelLabelsMap, option
|
|
|
198
206
|
wrapper,
|
|
199
207
|
dot,
|
|
200
208
|
line,
|
|
201
|
-
cachedBox: null, //
|
|
209
|
+
cachedBox: null, // Initialize cache
|
|
202
210
|
cachedTopPos: null
|
|
203
211
|
});
|
|
204
212
|
}
|
|
205
213
|
});
|
|
206
214
|
};
|
|
207
215
|
rebuildLabels();
|
|
208
|
-
//
|
|
216
|
+
// Optimized update function
|
|
209
217
|
const updateLabels = (timestamp) => {
|
|
210
218
|
if (!isActive || isPaused) {
|
|
211
219
|
rafId = null;
|
|
212
220
|
return;
|
|
213
221
|
}
|
|
214
|
-
//
|
|
222
|
+
// Throttle
|
|
215
223
|
if (cfg.updateInterval > 0 && timestamp - lastUpdateTime < cfg.updateInterval) {
|
|
216
224
|
rafId = requestAnimationFrame(updateLabels);
|
|
217
225
|
return;
|
|
@@ -224,7 +232,7 @@ function createModelsLabel(camera, renderer, parentModel, modelLabelsMap, option
|
|
|
224
232
|
svg.setAttribute('height', `${height}`);
|
|
225
233
|
labels.forEach((labelData) => {
|
|
226
234
|
const { el, wrapper, dot, line } = labelData;
|
|
227
|
-
const topWorld = getObjectTopPosition(labelData); //
|
|
235
|
+
const topWorld = getObjectTopPosition(labelData); // Use cache
|
|
228
236
|
const topNDC = topWorld.clone().project(camera);
|
|
229
237
|
const modelX = (topNDC.x * 0.5 + 0.5) * width + rect.left;
|
|
230
238
|
const modelY = (-(topNDC.y * 0.5) + 0.5) * height + rect.top;
|
|
@@ -256,10 +264,10 @@ function createModelsLabel(camera, renderer, parentModel, modelLabelsMap, option
|
|
|
256
264
|
rebuildLabels();
|
|
257
265
|
},
|
|
258
266
|
updateLabelsMap(newMap) {
|
|
259
|
-
currentLabelsMap =
|
|
267
|
+
currentLabelsMap = { ...newMap };
|
|
260
268
|
rebuildLabels();
|
|
261
269
|
},
|
|
262
|
-
//
|
|
270
|
+
// Pause update
|
|
263
271
|
pause() {
|
|
264
272
|
isPaused = true;
|
|
265
273
|
if (rafId !== null) {
|
|
@@ -267,7 +275,7 @@ function createModelsLabel(camera, renderer, parentModel, modelLabelsMap, option
|
|
|
267
275
|
rafId = null;
|
|
268
276
|
}
|
|
269
277
|
},
|
|
270
|
-
//
|
|
278
|
+
// Resume update
|
|
271
279
|
resume() {
|
|
272
280
|
if (!isPaused)
|
|
273
281
|
return;
|
package/dist/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/ui/modelsLabel.ts"],"sourcesContent":[null],"names":["THREE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/ui/modelsLabel.ts"],"sourcesContent":[null],"names":["THREE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;AASG;AA2BH;;;;;;;;;AASG;AACG,SAAU,iBAAiB,CAC/B,MAAoB,EACpB,QAA6B,EAC7B,WAA2B,EAC3B,cAAsC,EACtC,OAAsB,EAAA;AAEtB,IAAA,MAAM,GAAG,GAAG;AACV,QAAA,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,MAAM;AACrC,QAAA,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,SAAS;AAClC,QAAA,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,SAAS;AAC5C,QAAA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,UAAU;AACvC,QAAA,YAAY,EAAE,OAAO,EAAE,YAAY,IAAI,KAAK;AAC5C,QAAA,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,GAAG;AAC1B,QAAA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,CAAC;AAC9B,QAAA,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,CAAC;AACpC,QAAA,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,uBAAuB;AACxD,QAAA,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,CAAC;AAClC,QAAA,cAAc,EAAE,OAAO,EAAE,cAAc,IAAI,CAAC;AAC5C,QAAA,cAAc,EAAE,OAAO,E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