我用一个框架构建了一个简单的应用程序,我看到如果我在android设备上运行该应用程序,在任何mouseup事件之后,我的光标会移动到我点击的位置。这有点烦人,因为我使用vrbox控制器中的mouseup事件,该控制器将指针放在与应用程序光标不同的位置。我只想使用mouseup事件来运行与光标指向(然后不是控制器箭头指向)的对象相关的事件。
可能的解决方案是在任何mouseup事件之后阻塞光标位置。有办法做到这一点吗?提前感谢我的代码是这样的
home.html
<a-scene>
<a-entity id='cameraWrapper' position="0 -3 0" rotation="0 45 0">
<a-camera>
<a-entity cursor="fuse: true; fuseTimeout: 100;"
position="0 0 -1"
geometry="primitive: ring; radiusInner: 0.005; radiusOuter: 0.01"
material="color: black; shader: flat">
</a-entity>
</a-camera>
</a-entity>
<a-sky id="image-360" radius="20" src="./img/startroomHD.jpg"></a-sky>
<a-box event-listener position="-8 0 -8" rotation="0 45 0" depth="1" height="10" width="20"></a-box>
</a-scene>controller.js
angular.module('app.controller', ['app.service', 'firebase', 'ngCordova'])
.controller('HomeCtrl', function($scope){
AFRAME.registerComponent('event-listener', {
init: function () {
this.el.addEventListener('mouseup', function(evt){
console.log("ciao");
});
}
});
});发布于 2017-07-02 13:50:43
我们通常不想测试场景中的所有交叉点(例如,碰撞或点击)。由于交叉口测试是每秒运行60次以上的操作,因此选择性交叉点对于限制要测试交叉点的实体数量的性能是很好的。
要选择或拾取我们想要测试交集的实体,我们可以使用objects属性。如果未定义该属性,则光线投射器将测试场景中的每个对象是否相交。对象接受查询选择器值:
https://stackoverflow.com/questions/44865074
复制相似问题