我正在处理加载场景的threejs,并在dbl上单击添加了一个网格组件。我试图在屏幕上拖动它,所以我提到了https://threejs.org/examples/?q=drag#webgl_interactive_draggablecubes
$(document).on('addRectangle', function(d){
var sphere = new THREE.BoxGeometry(6,20,6);
var objectMesh = new THREE.Mesh( sphere, new THREE.MeshLambertMaterial( {color:0xff0000,visible:true} ));
scene.add(objectMesh);
objectMeshs.push(objectMesh);
var dragControls = new THREE.DragControls( objectMeshs, getCameraControl().activeCamera,renderer.domElement);
dragControls.addEventListener( 'dragstart', function ( event )
controls.enabled = false;
} );
dragControls.addEventListener( 'dragend', function ( event ) { controls.enabled = true; } );
needRefresh = true;
});
但是当继续双击时,它表示client.js:51358未捕获TypeError:_raycaster.setFromCamera不是HTMLCanvasElement.onDocumentMouseMove中的函数