This commit is contained in:
2025-08-12 19:52:18 +08:00
parent e39d2bda05
commit 4f5c5a707e
6 changed files with 107 additions and 49 deletions

View File

@@ -183,20 +183,14 @@ export default {
this.controls.enableZoom = true; // 启用缩放
this.controls.enablePan = true; // 启用平移(拖动)
this.controls.screenSpacePanning = true; // 2D平移模式
this.controls.touchZoomSpeed = 0.5; // 降低触摸缩放速度
this.controls.panSpeed = 0.5; // 降低平移速度
this.controls.touchZoomSpeed = 0.5;
this.controls.panSpeed = 0.5;
// 鼠标/触摸优化
this.controls.mouseButtons = {
LEFT: THREE.MOUSE.PAN, // 左键拖动
MIDDLE: THREE.MOUSE.DOLLY // 中键缩放(可选)
this.controls.touches = {
ONE: THREE.TOUCH.PAN, // 单指拖动为平移
TWO: THREE.TOUCH.DOLLY_PAN // 双指拖动为缩放和平移
};
// 触摸支持
this.controls.touchAction = 'none';
this.controls.touchPan = true;
this.controls.touchZoom = true;
// 添加错误处理逻辑
this.controls.addEventListener('error', (event) => {
console.error('OrbitControls error:', event);