为什么我的程序一直收到关于raycaster的警告?当我甚至不用它的时候 [英] Why my program keeps getting warning for "raycaster"? When I am not even using it

查看:9
本文介绍了为什么我的程序一直收到关于raycaster的警告?当我甚至不用它的时候的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我的代码在动画中旋转了一半后自动停止,并且我得到了与‘raycaster’相关的警告。你知道怎么修吗? 有谁能指出我可能犯的错误吗?

推荐答案

您可能正在使用cursor。A帧光标使用光线投射来检查交点。控制台警告您,provide a list of objects you want to be interactable的性能会更好。

您可以通过提供对象的选择器(例如按类)将对象列入白名单:

raycaster="objects: .interactable"

例如,您只能与类包含interactable

的对象交互
数据-lang="js"数据-隐藏="假"数据-控制台="假"数据-巴贝尔="假">
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
<a-scene cursor="rayOrigin: mouse;" raycaster="objects: .interactable">
  <a-box position="-1 0.5 -3" rotation="0 45 0" class="interactable"
    animation__on="property: scale; to: 1.2 1.2 1.2; dur: 200; easing: linear; 
    startEvents: mouseenter"
    animation__out="property: scale; to:  1 1 1; dur: 200; easing: linear;
    startEvents: mouseleave"
   color="#4CC3D9"></a-box>
   
  <a-box position="1 0.5 -3" rotation="0 45 0"
    animation__on="property: scale; to: 1.2 1.2 1.2; dur: 200; easing: linear; 
    startEvents: mouseenter"
    animation__out="property: scale; to:  1 1 1; dur: 200; easing: linear;
    startEvents: mouseleave"
   color="#AAFFaa"></a-box>
</a-scene>

这篇关于为什么我的程序一直收到关于raycaster的警告?当我甚至不用它的时候的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆