@qy_better_lib/hooks 0.2.23 → 0.2.25
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/lib/use-three/index.mjs +7 -21
- package/package.json +3 -3
package/lib/use-three/index.mjs
CHANGED
|
@@ -529,10 +529,7 @@ function use_renderer(current_three) {
|
|
|
529
529
|
try {
|
|
530
530
|
if (current_three.scene && current_three.camera && current_three.renderer) {
|
|
531
531
|
let hasCustomRender = false;
|
|
532
|
-
if (render_action)
|
|
533
|
-
render_action();
|
|
534
|
-
hasCustomRender = true;
|
|
535
|
-
}
|
|
532
|
+
if (render_action) ;
|
|
536
533
|
current_three.css2Renderer?.render(current_three.scene, current_three.camera);
|
|
537
534
|
if (!hasCustomRender) {
|
|
538
535
|
current_three.renderer.render(current_three.scene, current_three.camera);
|
|
@@ -547,23 +544,12 @@ function use_renderer(current_three) {
|
|
|
547
544
|
}
|
|
548
545
|
}
|
|
549
546
|
function render(render_action) {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
if (render_action) {
|
|
555
|
-
render_action();
|
|
556
|
-
hasCustomRender = true;
|
|
557
|
-
}
|
|
558
|
-
current_three.css2Renderer?.render(current_three.scene, current_three.camera);
|
|
559
|
-
if (!hasCustomRender) {
|
|
560
|
-
current_three.renderer?.render(current_three.scene, current_three.camera);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
});
|
|
547
|
+
render_action && render_action();
|
|
548
|
+
current_three.css2Renderer?.render(current_three.scene, current_three.camera);
|
|
549
|
+
if (!current_three.renderer?.xr.enabled) {
|
|
550
|
+
animation_frame_id = requestAnimationFrame(() => render(render_action));
|
|
564
551
|
} else {
|
|
565
|
-
|
|
566
|
-
animation_frame_id = requestAnimationFrame((timestamp) => render_loop(timestamp, render_action));
|
|
552
|
+
current_three.renderer?.setAnimationLoop(() => render(render_action));
|
|
567
553
|
}
|
|
568
554
|
}
|
|
569
555
|
function resize() {
|
|
@@ -640,7 +626,7 @@ function use_interaction(current_three) {
|
|
|
640
626
|
const y = -((e.clientY - rect.top) / rect.height) * 2 + 1;
|
|
641
627
|
const raycaster = new Raycaster();
|
|
642
628
|
raycaster.setFromCamera(new Vector2(x, y), current_three.camera);
|
|
643
|
-
const intersects = raycaster.intersectObjects(current_three.scene.children);
|
|
629
|
+
const intersects = raycaster.intersectObjects(current_three.scene.children, true);
|
|
644
630
|
if (intersects.length > 0) {
|
|
645
631
|
return intersects[0].object;
|
|
646
632
|
} else {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qy_better_lib/hooks",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.25",
|
|
5
5
|
"description": "qy better lib hooks",
|
|
6
6
|
"author": "luhuiming",
|
|
7
7
|
"license": "MIT",
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
"@antv/x6": "^2.18.1",
|
|
80
80
|
"@qy_better_lib/core": "^0.2.0",
|
|
81
81
|
"dagre": "^0.8.5",
|
|
82
|
-
"echarts": "5.6.0",
|
|
82
|
+
"echarts": "^5.6.0",
|
|
83
83
|
"mitt": "^3.0.1",
|
|
84
84
|
"mqtt": "^5.14.1",
|
|
85
|
-
"three": "^0.
|
|
85
|
+
"three": "^0.176.0",
|
|
86
86
|
"vue": "^3.5.22"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|