javascript - 错误 : ray. intersectScene 不是函数

标签 javascript three.js webgl

我一直在为一个简单的 WebGL 项目使用 sim.js 代码及其对象。当我需要使用 frustum 类(参见 this question )时,我必须更新我的 three.js。一件事坏了:

TypeError: ray.intersectScene is not a function                   sim.js(line 357)
     var intersects = ray.intersectScene( this.scene );

我在git上查看了源代码,ray.js中没有那个函数。如何更新此代码?

最佳答案

请参阅有关迁移的 three.js Wiki:https://github.com/mrdoob/three.js/wiki/Migration

Ray 中移除了 intersectScene。请改用 Raycaster.intersectObjects( array )

three.js r.61

关于javascript - 错误 : ray. intersectScene 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13129795/

相关文章:

javascript多级继承奇怪的结果

javascript - 如何让 Bootstrap 3 在下拉单击时下推页面内容

javascript - 从 DOM 中删除添加的突出显示

three.js - WebGL 改变形状动画

javascript - 如何使用 Lodash 将字符串与正则表达式匹配?

reactjs - 通过 react-three-fibre 中的 Prop 传递纹理的 URL

javascript - Three.js:奇怪的渲染结果

javascript - WebGL:如何通过矢量缩放对象,或生成此结果(包括图像)

javascript - WebGL 在像素级别混合颜色

javascript - 在 WEBGL 中获取学习矩阵的第一步